summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Allan Jansen <cliffjansen@apache.org>2012-02-09 17:40:14 +0000
committerClifford Allan Jansen <cliffjansen@apache.org>2012-02-09 17:40:14 +0000
commit19a3076040f4d144e604f825b59e48ab27524440 (patch)
tree7c08494ecbca9d17763a815e3d98c74b3c4df887
parent1c21d7c23b4a5e54d824e4861dd7aca511340b66 (diff)
downloadqpid-python-19a3076040f4d144e604f825b59e48ab27524440.tar.gz
QPID-3621 cmake build changes for solaris and solaris specific code changes
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1242411 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/CMakeLists.txt35
-rw-r--r--qpid/cpp/src/cluster.cmake2
-rw-r--r--qpid/cpp/src/qpid/store/CMakeLists.txt8
-rw-r--r--qpid/cpp/src/qpid/sys/posix/SocketAddress.cpp8
-rwxr-xr-xqpid/cpp/src/qpid/sys/solaris/SystemInfo.cpp7
-rw-r--r--qpid/cpp/src/rdma.cmake6
-rw-r--r--qpid/cpp/src/ssl.cmake4
7 files changed, 46 insertions, 24 deletions
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index c5d2a45f69..41d3cec1f6 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -269,6 +269,12 @@ if (CMAKE_COMPILER_IS_GNUCXX)
# -Wshadow - warns about boost headers.
set (WARNING_FLAGS
"-Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -Woverloaded-virtual")
+
+ set (GCC_CATCH_UNDEFINED "-Wl,--no-undefined")
+ # gcc on SunOS uses native linker whose "-z defs" is too fussy
+ if (CMAKE_SYSTEM_NAME STREQUAL SunOS)
+ set (GCC_CATCH_UNDEFINED "")
+ endif (CMAKE_SYSTEM_NAME STREQUAL SunOS)
endif (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
@@ -546,7 +552,7 @@ if (BUILD_XML)
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties (xml PROPERTIES
PREFIX ""
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS ${GCC_CATCH_UNDEFINED})
endif (CMAKE_COMPILER_IS_GNUCXX)
install (TARGETS xml
DESTINATION ${QPIDD_MODULE_DIR}
@@ -581,7 +587,7 @@ if (BUILD_ACL)
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties (acl PROPERTIES
PREFIX ""
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS "${GCC_CATCH_UNDEFINED}")
endif (CMAKE_COMPILER_IS_GNUCXX)
install (TARGETS acl
DESTINATION ${QPIDD_MODULE_DIR}
@@ -706,23 +712,28 @@ else (CMAKE_SYSTEM_NAME STREQUAL Windows)
add_definitions(-pthread)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
if (CMAKE_COMPILER_IS_GNUCXX)
- set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -pthread")
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GCC_CATCH_UNDEFINED} -pthread")
endif (CMAKE_COMPILER_IS_GNUCXX)
endif (CMAKE_SYSTEM_NAME STREQUAL Linux)
- if (CMAKE_SYSTEM_NAME STREQUAL SunOS)
- set (qpid_poller_module
- qpid/sys/solaris/ECFPoller.cpp
- qpid/sys/solaris/SystemInfo.cpp
- )
- endif (CMAKE_SYSTEM_NAME STREQUAL SunOS)
-
set (qpidtypes_platform_SOURCES)
set (qpidtypes_platform_LIBS
uuid
${Boost_SYSTEM_LIBRARY}
)
+ if (CMAKE_SYSTEM_NAME STREQUAL SunOS)
+ set (qpid_poller_module
+ qpid/sys/posix/PosixPoller.cpp
+ qpid/sys/solaris/SystemInfo.cpp
+ )
+# On Sun we want -lpthread -lthread as the 2nd last and last libs passed to linker
+ set (qpidtypes_platform_LIBS ${qpidtypes_platform_LIBS}
+ pthread
+ thread
+ )
+ endif (CMAKE_SYSTEM_NAME STREQUAL SunOS)
+
set (qpidcommon_platform_SOURCES
qpid/sys/posix/AsynchIO.cpp
qpid/sys/posix/Fork.cpp
@@ -1318,7 +1329,7 @@ target_link_libraries (replicating_listener qpidbroker ${Boost_PROGRAM_OPTIONS_L
set_target_properties (replicating_listener PROPERTIES PREFIX "")
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(replicating_listener PROPERTIES
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS "${GCC_CATCH_UNDEFINED}")
endif (CMAKE_COMPILER_IS_GNUCXX)
install (TARGETS replicating_listener
DESTINATION ${QPIDD_MODULE_DIR}
@@ -1339,7 +1350,7 @@ target_link_libraries (replication_exchange qpidbroker)
set_target_properties (replication_exchange PROPERTIES PREFIX "")
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(replication_exchange PROPERTIES
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS "${GCC_CATCH_UNDEFINED}")
endif (CMAKE_COMPILER_IS_GNUCXX)
install (TARGETS replication_exchange
DESTINATION ${QPIDD_MODULE_DIR}
diff --git a/qpid/cpp/src/cluster.cmake b/qpid/cpp/src/cluster.cmake
index 0b0e26141f..815cdffdec 100644
--- a/qpid/cpp/src/cluster.cmake
+++ b/qpid/cpp/src/cluster.cmake
@@ -154,7 +154,7 @@ if (BUILD_CLUSTER)
# Turn off optimisation based on strict-aliasing because we get warnings about violations
set_target_properties(cluster cluster_shared PROPERTIES
COMPILE_FLAGS "-fno-strict-aliasing"
- LINK_FLAGS "-Wl,--no-undefined -pthread")
+ LINK_FLAGS "${GCC_CATCH_UNDEFINED} -pthread")
endif (CMAKE_COMPILER_IS_GNUCXX)
add_library (watchdog MODULE qpid/cluster/WatchDogPlugin.cpp)
diff --git a/qpid/cpp/src/qpid/store/CMakeLists.txt b/qpid/cpp/src/qpid/store/CMakeLists.txt
index 464d2de052..9abdf0ae3d 100644
--- a/qpid/cpp/src/qpid/store/CMakeLists.txt
+++ b/qpid/cpp/src/qpid/store/CMakeLists.txt
@@ -34,9 +34,15 @@ set (store_SOURCES
add_library (store MODULE ${store_SOURCES})
target_link_libraries (store qpidbroker ${Boost_PROGRAM_OPTIONS_LIBRARY})
if (CMAKE_COMPILER_IS_GNUCXX)
+ set (GCC_CATCH_UNDEFINED "-Wl,--no-undefined")
+ # gcc on SunOS uses native linker whose "-z defs" is too fussy
+ if (CMAKE_SYSTEM_NAME STREQUAL SunOS)
+ set (GCC_CATCH_UNDEFINED "")
+ endif (CMAKE_SYSTEM_NAME STREQUAL SunOS)
+
set_target_properties (store PROPERTIES
PREFIX ""
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS "${GCC_CATCH_UNDEFINED}")
endif (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
diff --git a/qpid/cpp/src/qpid/sys/posix/SocketAddress.cpp b/qpid/cpp/src/qpid/sys/posix/SocketAddress.cpp
index 077942ef2f..6d5cf16b54 100644
--- a/qpid/cpp/src/qpid/sys/posix/SocketAddress.cpp
+++ b/qpid/cpp/src/qpid/sys/posix/SocketAddress.cpp
@@ -84,8 +84,8 @@ std::string SocketAddress::asString(::sockaddr const * const addr, size_t addrle
uint16_t SocketAddress::getPort(::sockaddr const * const addr)
{
switch (addr->sa_family) {
- case AF_INET: return ntohs(((::sockaddr_in*)addr)->sin_port);
- case AF_INET6: return ntohs(((::sockaddr_in6*)addr)->sin6_port);
+ case AF_INET: return ntohs(((::sockaddr_in*)(void*)addr)->sin_port);
+ case AF_INET6: return ntohs(((::sockaddr_in6*)(void*)addr)->sin6_port);
default:throw Exception(QPID_MSG("Unexpected socket type"));
}
}
@@ -112,8 +112,8 @@ void SocketAddress::setAddrInfoPort(uint16_t port) {
::addrinfo& ai = *currentAddrInfo;
switch (ai.ai_family) {
- case AF_INET: ((::sockaddr_in*)ai.ai_addr)->sin_port = htons(port); return;
- case AF_INET6:((::sockaddr_in6*)ai.ai_addr)->sin6_port = htons(port); return;
+ case AF_INET: ((::sockaddr_in*)(void*)ai.ai_addr)->sin_port = htons(port); return;
+ case AF_INET6:((::sockaddr_in6*)(void*)ai.ai_addr)->sin6_port = htons(port); return;
default: throw Exception(QPID_MSG("Unexpected socket type"));
}
}
diff --git a/qpid/cpp/src/qpid/sys/solaris/SystemInfo.cpp b/qpid/cpp/src/qpid/sys/solaris/SystemInfo.cpp
index 765e5a7eb0..e5856f55e6 100755
--- a/qpid/cpp/src/qpid/sys/solaris/SystemInfo.cpp
+++ b/qpid/cpp/src/qpid/sys/solaris/SystemInfo.cpp
@@ -69,7 +69,12 @@ void SystemInfo::getLocalIpAddresses(uint16_t port,
if (::ioctl(s, SIOCGIFADDR, &ifr) < 0) {
break;
}
- struct sockaddr_in *sin = (struct sockaddr_in *) &ifr.lifr_addr;
+ struct sockaddr *sa = static_cast<struct sockaddr *>((void *) &ifr.lifr_addr);
+ if (sa->sa_family != AF_INET) {
+ // TODO: Url parsing currently can't cope with IPv6 addresses, defer for now
+ break;
+ }
+ struct sockaddr_in *sin = static_cast<struct sockaddr_in *>((void *)sa);
std::string addr(inet_ntoa(sin->sin_addr));
if (addr != LOCALHOST)
addrList.push_back(Address(TCP, addr, port));
diff --git a/qpid/cpp/src/rdma.cmake b/qpid/cpp/src/rdma.cmake
index 1d840e5d18..b0d92facab 100644
--- a/qpid/cpp/src/rdma.cmake
+++ b/qpid/cpp/src/rdma.cmake
@@ -68,7 +68,7 @@ if (BUILD_RDMA)
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(rdmawrap PROPERTIES
COMPILE_FLAGS -Wno-missing-field-initializers
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS ${GCC_CATCH_UNDEFINED})
endif (CMAKE_COMPILER_IS_GNUCXX)
install (TARGETS rdmawrap
@@ -83,7 +83,7 @@ if (BUILD_RDMA)
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(rdma PROPERTIES
COMPILE_FLAGS -Wno-missing-field-initializers
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS ${GCC_CATCH_UNDEFINED})
endif (CMAKE_COMPILER_IS_GNUCXX)
install (TARGETS rdma
@@ -98,7 +98,7 @@ if (BUILD_RDMA)
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(rdmaconnector PROPERTIES
COMPILE_FLAGS -Wno-missing-field-initializers
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS ${GCC_CATCH_UNDEFINED})
endif (CMAKE_COMPILER_IS_GNUCXX)
install (TARGETS rdmaconnector
diff --git a/qpid/cpp/src/ssl.cmake b/qpid/cpp/src/ssl.cmake
index 6bc1d07d6d..d66f59cfff 100644
--- a/qpid/cpp/src/ssl.cmake
+++ b/qpid/cpp/src/ssl.cmake
@@ -97,7 +97,7 @@ if (BUILD_SSL)
COMPILE_FLAGS ${NSS_COMPILE_FLAGS})
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(ssl PROPERTIES
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS "${GCC_CATCH_UNDEFINED}")
endif (CMAKE_COMPILER_IS_GNUCXX)
install (TARGETS ssl
@@ -111,7 +111,7 @@ if (BUILD_SSL)
COMPILE_FLAGS ${NSS_COMPILE_FLAGS})
if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties(sslconnector PROPERTIES
- LINK_FLAGS -Wl,--no-undefined)
+ LINK_FLAGS "${GCC_CATCH_UNDEFINED}")
endif (CMAKE_COMPILER_IS_GNUCXX)
install (TARGETS sslconnector