Unverified Commit 8c338f4d authored by Dominik Charousset's avatar Dominik Charousset Committed by GitHub

Merge pull request #955

OpenBSD support
parents cd92c25e 59f61c9b
......@@ -168,7 +168,12 @@ math(EXPR CAF_VERSION_PATCH "${VERSION_INT} % 100")
# create full version string
set(CAF_VERSION
"${CAF_VERSION_MAJOR}.${CAF_VERSION_MINOR}.${CAF_VERSION_PATCH}")
# set the library version for our shared library targets
if(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
set(CAF_LIB_VERSION "${CAF_VERSION_MAJOR}.${CAF_VERSION_MINOR}")
else()
set(CAF_LIB_VERSION "${CAF_VERSION}")
endif()
################################################################################
# set output paths for binaries and libraries if not provided by the user #
......
......@@ -181,7 +181,7 @@ if (NOT CAF_BUILD_STATIC_ONLY)
set_target_properties(libcaf_core_shared
PROPERTIES
SOVERSION ${CAF_VERSION}
VERSION ${CAF_VERSION}
VERSION ${CAF_LIB_VERSION}
OUTPUT_NAME caf_core
)
install(TARGETS libcaf_core_shared
......
......@@ -209,6 +209,8 @@
# endif
#elif defined(__FreeBSD__)
# define CAF_BSD
#elif defined(__OpenBSD__)
# define CAF_BSD
#elif defined(__CYGWIN__)
# define CAF_CYGWIN
#elif defined(WIN32) || defined(_WIN32)
......
......@@ -64,7 +64,7 @@ if (NOT CAF_BUILD_STATIC_ONLY)
set_target_properties(libcaf_io_shared
PROPERTIES
SOVERSION ${CAF_VERSION}
VERSION ${CAF_VERSION}
VERSION ${CAF_LIB_VERSION}
OUTPUT_NAME caf_io)
install(TARGETS libcaf_io_shared
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
......
......@@ -288,8 +288,10 @@ bool interfaces::get_endpoint(const std::string& host, uint16_t port,
hint.ai_socktype = SOCK_DGRAM;
if (preferred)
hint.ai_family = *preferred == protocol::network::ipv4 ? AF_INET : AF_INET6;
#ifdef AI_V4MAPPED
if (hint.ai_family == AF_INET6)
hint.ai_flags = AI_V4MAPPED;
#endif
addrinfo* tmp = nullptr;
if (getaddrinfo(host.c_str(), port_hint, &hint, &tmp) != 0)
return false;
......
......@@ -93,9 +93,9 @@ const int ec_out_of_memory = ENOMEM;
const int ec_interrupted_syscall = EINTR;
#endif
// platform-dependent SIGPIPE setup
#if defined(CAF_MACOS) || defined(CAF_IOS) || defined(CAF_BSD)
// Use the socket option but no flags to recv/send on macOS/iOS/BSD.
// Platform-dependent setup for supressing SIGPIPE.
#if defined(CAF_MACOS) || defined(CAF_IOS) || defined(__FreeBSD__)
// Set the SO_NOSIGPIPE socket option on macOS, iOS and FreeBSD.
const int no_sigpipe_socket_flag = SO_NOSIGPIPE;
const int no_sigpipe_io_flag = 0;
#elif defined(CAF_WINDOWS)
......@@ -103,7 +103,7 @@ const int no_sigpipe_io_flag = 0;
const int no_sigpipe_socket_flag = 0;
const int no_sigpipe_io_flag = 0;
#else
// Use flags to recv/send on Linux/Android but no socket option.
// Pass MSG_NOSIGNAL to recv/send on Linux/Android/OpenBSD.
const int no_sigpipe_socket_flag = 0;
const int no_sigpipe_io_flag = MSG_NOSIGNAL;
#endif
......
......@@ -28,7 +28,7 @@ if(NOT CAF_BUILD_STATIC_ONLY)
set_target_properties(libcaf_opencl_shared
PROPERTIES
SOVERSION "${CAF_VERSION}"
VERSION "${CAF_VERSION}"
VERSION "${CAF_LIB_VERSION}"
OUTPUT_NAME caf_opencl)
install(TARGETS libcaf_opencl_shared LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
......
......@@ -32,7 +32,7 @@ if (NOT CAF_BUILD_STATIC_ONLY)
set_target_properties(libcaf_openssl_shared
PROPERTIES
SOVERSION ${CAF_VERSION}
VERSION ${CAF_VERSION}
VERSION ${CAF_LIB_VERSION}
OUTPUT_NAME caf_openssl)
if (CYGWIN)
install(TARGETS libcaf_openssl_shared RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment