summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2012-02-21 22:44:03 +0000
committerAndrew Stitcher <astitcher@apache.org>2012-02-21 22:44:03 +0000
commit60a803992f70816a69ab31f987645289b2ad95dc (patch)
tree9b2c5a530276a7b59d5b8e130e95764eb1c2dd5d /qpid/cpp/src
parentf1a5a7ba9acbca5958a268d5d92eae9987ce6458 (diff)
downloadqpid-python-60a803992f70816a69ab31f987645289b2ad95dc.tar.gz
QPID-3571: A generic Posix poller implementation
Wired manual selection of poll/epoll implementations into autoconf/cmake. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1292066 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/CMakeLists.txt32
-rw-r--r--qpid/cpp/src/Makefile.am8
2 files changed, 33 insertions, 7 deletions
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index a258605a1e..cfcdead883 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -487,6 +487,19 @@ if (NOT BUILD_PROBES)
set (HAVE_SYS_SDT_H 0)
endif (NOT BUILD_PROBES)
+# Check for poll/epoll header files
+check_include_files(sys/poll.h HAVE_POLL)
+check_include_files(sys/epoll.h HAVE_EPOLL)
+
+# Set default poller implementation (check from general to specific to allow overriding)
+if (HAVE_POLL)
+ set(poller_default poll)
+endif (HAVE_POLL)
+if (HAVE_EPOLL)
+ set(poller_default epoll)
+endif (HAVE_EPOLL)
+set(POLLER ${poller_default} CACHE STRING "Poller implementation (poll/epoll)")
+
# If not windows ensure that we have uuid library
if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
CHECK_LIBRARY_EXISTS (uuid uuid_compare "" HAVE_UUID)
@@ -750,9 +763,18 @@ else (CMAKE_SYSTEM_NAME STREQUAL Windows)
# POSIX (Non-Windows) platforms have a lot of overlap in sources; the only
# major difference is the poller module.
- if (CMAKE_SYSTEM_NAME STREQUAL Linux)
+ if (POLLER STREQUAL poll)
+ set (qpid_poller_module
+ qpid/sys/posix/PosixPoller.cpp
+ )
+ elseif (POLLER STREQUAL epoll)
set (qpid_poller_module
qpid/sys/epoll/EpollPoller.cpp
+ )
+ endif (POLLER STREQUAL poll)
+
+ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
+ set (qpid_system_module
qpid/sys/posix/SystemInfo.cpp
)
add_definitions(-pthread)
@@ -764,13 +786,12 @@ else (CMAKE_SYSTEM_NAME STREQUAL Windows)
set (qpidtypes_platform_SOURCES)
set (qpidtypes_platform_LIBS
- uuid
- ${Boost_SYSTEM_LIBRARY}
+ uuid
+ ${Boost_SYSTEM_LIBRARY}
)
if (CMAKE_SYSTEM_NAME STREQUAL SunOS)
- set (qpid_poller_module
- qpid/sys/posix/PosixPoller.cpp
+ set (qpid_system_module
qpid/sys/solaris/SystemInfo.cpp
)
# On Sun we want -lpthread -lthread as the 2nd last and last libs passed to linker
@@ -799,6 +820,7 @@ else (CMAKE_SYSTEM_NAME STREQUAL Windows)
qpid/sys/posix/Time.cpp
qpid/SaslFactory.cpp
+ ${qpid_system_module}
${qpid_poller_module}
)
set (qpidcommon_platform_LIBS
diff --git a/qpid/cpp/src/Makefile.am b/qpid/cpp/src/Makefile.am
index a909ed8185..a954f28577 100644
--- a/qpid/cpp/src/Makefile.am
+++ b/qpid/cpp/src/Makefile.am
@@ -183,11 +183,15 @@ nobase_include_HEADERS += \
../include/qpid/sys/posix/Time.h \
../include/qpid/sys/posix/check.h
-if HAVE_EPOLL
+if USE_EPOLL
poller = qpid/sys/epoll/EpollPoller.cpp
endif
-if HAVE_ECF
+if USE_POLL
+ poller = qpid/sys/posix/PosixPoller.cpp
+endif
+
+if USE_ECF
poller = qpid/sys/solaris/ECFPoller.cpp
endif