diff options
author | Stephen D. Huston <shuston@apache.org> | 2009-04-23 22:59:12 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2009-04-23 22:59:12 +0000 |
commit | 3c95f9a289fee6a3b43608ec2ac95f841c43e3ff (patch) | |
tree | 5860c778c3e2b2c6c23b49887ae870cb5d4558ff /cpp/src | |
parent | 7db52d95099fb7ae237277f12e4e368cf643f174 (diff) | |
download | qpid-python-3c95f9a289fee6a3b43608ec2ac95f841c43e3ff.tar.gz |
Merge in initial changes to allow building with CMake; rubygen and managementgen can now generate either .mk files or .cmake files as needed; CONF_FILE and MODULE_DIR macros now have broker/client counterparts QPIDD_CONF_FILE, QPIDD_MODULE_DIR, QPIDC_CONF_FILE, QPIDC_MODULE_DIR configurable by cmake
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@768085 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/CMakeLists.txt | 647 | ||||
-rw-r--r-- | cpp/src/Makefile.am | 4 | ||||
-rw-r--r-- | cpp/src/cluster.cmake | 119 | ||||
-rw-r--r-- | cpp/src/config.h.cmake | 51 | ||||
-rw-r--r-- | cpp/src/posix/QpiddBroker.cpp | 9 | ||||
-rw-r--r-- | cpp/src/qpid/CommonImportExport.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/broker/BrokerImportExport.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/ClientImportExport.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/client/LoadPlugins.cpp | 5 | ||||
-rw-r--r-- | cpp/src/qpid/client/SslConnector.cpp | 3 | ||||
-rw-r--r-- | cpp/src/rdma.cmake | 94 | ||||
-rw-r--r-- | cpp/src/ssl.cmake | 105 | ||||
-rw-r--r-- | cpp/src/ssl.mk | 2 | ||||
-rw-r--r-- | cpp/src/tests/CMakeLists.txt | 253 | ||||
-rw-r--r-- | cpp/src/windows/QpiddBroker.cpp | 25 |
15 files changed, 1299 insertions, 24 deletions
diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt new file mode 100644 index 0000000000..9d6d8a2f3b --- /dev/null +++ b/cpp/src/CMakeLists.txt @@ -0,0 +1,647 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +include(CheckFunctionExists) +include(CheckIncludeFiles) +include(CheckLibraryExists) +include(CheckSymbolExists) +include(FindBoost) +include(FindDoxygen) + +set (CMAKE_VERBOSE_MAKEFILE ON) # for dubugging + +# check if we generate source as part of the build +# - rubygen generates the amqp spec and clustering +# - managementgen generates the broker management code +# +# rubygen subdir is excluded from stable distributions +# If the main AMQP spec is present, then check if ruby and python are +# present, and if any sources have changed, forcing a re-gen of source code. + +set(AMQP_SPEC_DIR ${qpidc_SOURCE_DIR}/../specs) +set(AMQP_SPEC ${AMQP_SPEC_DIR}/amqp.0-10-qpid-errata.xml) +if (EXISTS ${AMQP_SPEC}) + include(FindRuby) + include(FindPythonInterp) + if (NOT RUBY_EXECUTABLE) + message(FATAL_ERROR "Can't locate ruby, needed to generate source files.") + endif (NOT RUBY_EXECUTABLE) + if (NOT PYTHON_EXECUTABLE) + message(FATAL_ERROR "Can't locate python, needed to generate source files.") + endif (NOT PYTHON_EXECUTABLE) + + set(specs ${AMQP_SPEC} ${qpidc_SOURCE_DIR}/xml/cluster.xml) + set(regen_amqp OFF) + set(rgen_dir ${qpidc_SOURCE_DIR}/rubygen) + file(GLOB_RECURSE rgen_progs ${rgen_dir}/*.rb) + # If any of the specs, or any of the sources used to generate code, change + # then regenerate the sources. + foreach (spec_file ${specs} ${rgen_progs}) + if (${spec_file} IS_NEWER_THAN ${CMAKE_CURRENT_SOURCE_DIR}/rubygen.cmake) + set(regen_amqp ON) + endif (${spec_file} IS_NEWER_THAN ${CMAKE_CURRENT_SOURCE_DIR}/rubygen.cmake) + endforeach (spec_file ${specs}) + if (regen_amqp) + message(STATUS "Regenerating AMQP protocol sources") + execute_process(COMMAND ${RUBY_EXECUTABLE} -I ${rgen_dir} ${rgen_dir}/generate gen ${specs} all ${CMAKE_CURRENT_SOURCE_DIR}/rubygen.cmake + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + else (regen_amqp) + message(STATUS "No need to generate AMQP protocol sources") + endif (regen_amqp) + + set(mgmt_specs ${AMQP_SPEC_DIR}/management-schema.xml + ${CMAKE_CURRENT_SOURCE_DIR}/qpid/acl/management-schema.xml + ${CMAKE_CURRENT_SOURCE_DIR}/qpid/cluster/management-schema.xml) + set(mgen_dir ${qpidc_SOURCE_DIR}/managementgen) + set(regen_mgmt OFF) + foreach (spec_file ${mgmt_specs}) + if (${spec_file} IS_NEWER_THAN ${CMAKE_CURRENT_SOURCE_DIR}/managementgen.cmake) + message(STATUS "${spec_file} is newer") + set(regen_mgmt ON) + endif (${spec_file} IS_NEWER_THAN ${CMAKE_CURRENT_SOURCE_DIR}/managementgen.cmake) + endforeach (spec_file ${mgmt_specs}) + if (regen_mgmt) + message(STATUS, "Regenerating Qpid Management Framework sources") + execute_process(COMMAND ${PYTHON_EXECUTABLE} ${mgen_dir}/qmf-gen -c ${CMAKE_CURRENT_SOURCE_DIR}/managementgen.cmake -q -o gen/qmf ${mgmt_specs} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + else (regen_mgmt) + message(STATUS "No need to generate Qpid Management Framework sources") + endif (regen_mgmt) + +else (EXISTS ${AMQP_SPEC}) + message(STATUS "No AMQP spec... won't generate sources") +endif (EXISTS ${AMQP_SPEC}) + +# Pull in the names of the generated files, i.e. ${rgen_framing_srcs} +include (rubygen.cmake) +include (managementgen.cmake) + +find_program(HELP2MAN help2man DOC "Location of the help2man program") +option(GEN_MANPAGES "Use help2man to generate man pages" ON) +if (GEN_MANPAGES AND NOT HELP2MAN) + message(STATUS "Can't locate the help2man command; man pages will not be generated") +endif (GEN_MANPAGES AND NOT HELP2MAN) + +# FindDoxygen module tries to locate doxygen and Graphviz dot +option(GEN_DOXYGEN "Use doxygen to generate user documentation" ON) +if (GEN_DOXYGEN AND NOT DOXYGEN_EXECUTABLE) + message(STATUS "Can't locate the doxygen command; user documentation will not be generated") +endif (GEN_DOXYGEN AND NOT DOXYGEN_EXECUTABLE) + +find_program(VALGRIND valgrind DOC "Location of the valgrind program") +option(ENABLE_VALGRIND "Use valgrind to detect run-time problems" ON) +if (ENABLE_VALGRIND AND NOT VALGRIND) + message(STATUS "Can't locate the valgrind command; no run-time error detection") +endif (ENABLE_VALGRIND AND NOT VALGRIND) + +set(QPIDC_MODULE_DIR "." CACHE STRING + "Directory to load client plug-in modules from") +set(QPIDD_MODULE_DIR "." CACHE STRING + "Directory to load broker plug-in modules from") +set(QPIDC_CONF_FILE "qpidc.conf" CACHE STRING + "Name of the Qpid client configuration file") +set(QPIDD_CONF_FILE "qpidd.conf" CACHE STRING + "Name of the Qpid broker configuration file") + +option(ENABLE_WARNINGS "Enable lots of compiler warnings (recommended)" ON) +if (ENABLE_WARNINGS AND CMAKE_COMPILER_IS_GNUCXX) + # Warnings: Enable as many as possible, keep the code clean. Please + # do not disable warnings or remove -Werror without discussing on + # qpid-dev list. + # + # The following warnings are deliberately omitted, they warn on valid code. + # -Wunreachable-code -Wpadded -Winline + # -Wshadow - warns about boost headers. + add_definitions(-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) +endif (ENABLE_WARNINGS AND CMAKE_COMPILER_IS_GNUCXX) + +# Expand a bit from the basic Find_Boost; be specific about what's needed. +find_package(Boost 1.33 REQUIRED + COMPONENTS date_time program_options thread unit_test_framework) +if(NOT Boost_FOUND) + message(FATAL_ERROR "Boost C++ libraries not found. Please install or try setting BOOST_ROOT") +endif(NOT Boost_FOUND) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/config.h) + +include_directories( ${Boost_INCLUDE_DIR} ) + +include_directories( . ) +include_directories( gen ) +include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) + +link_directories( ${Boost_LIBRARY_DIRS} ) + +CHECK_LIBRARY_EXISTS (rt clock_gettime "" CLOCK_GETTIME_IN_RT) +if (NOT CLOCK_GETTIME_IN_RT) + CHECK_FUNCTION_EXISTS (clock_gettime QPID_HAS_CLOCK_GETTIME) +else (NOT CLOCK_GETTIME_IN_RT) + set(CMAKE_REQUIRED_LIBS ${CMAKE_REQUIRED_LIBS} rt) + set(QPID_HAS_CLOCK_GETTIME YES CACHE BOOL "Platform has clock_gettime") +endif (NOT CLOCK_GETTIME_IN_RT) + +# See if Cyrus SASL is desired and available +option(QPID_HAS_SASL "Build with Cyrus SASL support" ON) +if (QPID_HAS_SASL) + CHECK_LIBRARY_EXISTS (sasl2 sasl_checkpass "" HAVE_SASL2) + CHECK_INCLUDE_FILES (sasl/sasl.h HAVE_SASL_H) + if (NOT HAVE_SASL2) + message(FATAL_ERROR "Cyrus SASL support requested but libsasl2 not found") + endif (NOT HAVE_SASL2) + if (NOT HAVE_SASL_H) + message(FATAL_ERROR "Cyrus SASL support requested but sasl.h not found") + endif (NOT HAVE_SASL_H) + + set(BROKER_SASL_NAME "qpidd" CACHE STRING "SASL app name for the qpid broker") + set(qpidcommon_sasl_source + qpid/sys/cyrus/CyrusSecurityLayer.h + qpid/sys/cyrus/CyrusSecurityLayer.cpp + ) + set(qpidcommon_sasl_lib sasl2) + +endif (QPID_HAS_SASL) + +# See if XML Exchange is desired and prerequisites are available +if (CMAKE_SYSTEM_NAME STREQUAL Windows) + set (xml_default OFF) +else (CMAKE_SYSTEM_NAME STREQUAL Windows) + set (xml_default ON) +endif (CMAKE_SYSTEM_NAME STREQUAL Windows) + +option(QPID_HAS_XML "Build with XML Exchange" ${xml_default}) +if (QPID_HAS_XML) + CHECK_LIBRARY_EXISTS (xerces-c _init "" HAVE_XERCES) + CHECK_INCLUDE_FILES (xercesc/framework/MemBufInputSource.hpp HAVE_XERCES_H) + CHECK_INCLUDE_FILES (xqilla/xqilla-simple.hpp HAVE_XQILLA_H) + if (NOT HAVE_XERCES) + message(FATAL_ERROR "XML Exchange support requested but xerces-c library not found") + endif (NOT HAVE_XERCES) + if (NOT HAVE_XERCES_H) + message(FATAL_ERROR "XML Exchange support requested but Xerces-C headers not found") + endif (NOT HAVE_XERCES_H) + if (NOT HAVE_XQILLA_H) + message(FATAL_ERROR "XML Exchange support requested but XQilla headers not found") + endif (NOT HAVE_XQILLA_H) + + add_library (xml SHARED + qpid/xml/XmlExchange.cpp + qpid/xml/XmlExchange.h + qpid/xml/XmlExchangePlugin.cpp) + target_link_libraries (xml xerces-c xqilla qpidbroker) + set_target_properties (xml PROPERTIES + VERSION ${qpidc_version} + LINK_FLAGS -Wl,--no-undefined) +endif (QPID_HAS_XML) + +# Build the ACL plugin +set (acl_SOURCES + qpid/acl/Acl.cpp + qpid/acl/Acl.h + qpid/acl/AclData.cpp + qpid/acl/AclData.h + qpid/acl/AclPlugin.cpp + qpid/acl/AclReader.cpp + qpid/acl/AclReader.h + ) + add_library (acl SHARED ${acl_SOURCES}) + target_link_libraries (acl qpidbroker) + set_target_properties (acl PROPERTIES + VERSION ${qpidc_version} + LINK_FLAGS -Wl,--no-undefined) + +# Check for optional cluster support requirements +include (cluster.cmake) + +# Check for optional RDMA support requirements +include (rdma.cmake) + +# Check for optional SSL support requirements +include (ssl.cmake) + +# Check for syslog capabilities not present on all systems +check_symbol_exists (LOG_AUTHPRIV "sys/syslog.h" HAVE_LOG_AUTHPRIV) +check_symbol_exists (LOG_FTP "sys/syslog.h" HAVE_LOG_FTP) + +if (CMAKE_SYSTEM_NAME STREQUAL Windows) + if (MSVC) + add_definitions( + /D "_CRT_NONSTDC_NO_WARNINGS" + /D "NOMINMAX" + /D "WIN32_LEAN_AND_MEAN" + /D "_SCL_SECURE_NO_WARNINGS" + /wd4244 + /wd4800 + /wd4355 + ) + endif (MSVC) + + set (libqpidcommon_platform_SOURCES + qpid/log/windows/SinkOptions.cpp + qpid/sys/windows/AsynchIO.cpp + qpid/sys/windows/FileSysDir.cpp + qpid/sys/windows/IocpPoller.cpp + qpid/sys/windows/IOHandle.cpp + qpid/sys/windows/LockFile.cpp + qpid/sys/windows/PollableCondition.cpp + qpid/sys/windows/Shlib.cpp + qpid/sys/windows/Socket.cpp + qpid/sys/windows/StrError.cpp + qpid/sys/windows/SystemInfo.cpp + qpid/sys/windows/Thread.cpp + qpid/sys/windows/Time.cpp + qpid/sys/windows/uuid.cpp + ) + set (libqpidcommon_platform_LIBS + rpcrt4 ws2_32 + ) + set (libqpidbroker_platform_SOURCES + qpid/broker/windows/BrokerDefaults.cpp + qpid/broker/windows/SaslAuthenticator.cpp + ) + + set (libqpidclient_platform_SOURCES + qpid/client/windows/SaslFactory.cpp + ) + + set (qpidd_platform_SOURCES + windows/QpiddBroker.cpp + ) + +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) + set (qpid_poller_module qpid/sys/epoll/EpollPoller.cpp) + add_definitions(-pthread) + set (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -pthread) + endif (CMAKE_SYSTEM_NAME STREQUAL Linux) + if (CMAKE_SYSTEM_NAME STREQUAL SunOS) + set (qpid_poller_module qpid/sys/solaris/ECFPoller.cpp) + endif (CMAKE_SYSTEM_NAME STREQUAL SunOS) + + set (libqpidcommon_platform_SOURCES + qpid/sys/posix/AsynchIO.cpp + qpid/sys/posix/Fork.cpp + qpid/sys/posix/FileSysDir.cpp + qpid/sys/posix/IOHandle.cpp + qpid/sys/posix/LockFile.cpp + qpid/sys/posix/Mutex.cpp + qpid/sys/posix/PollableCondition.cpp + qpid/sys/posix/Shlib.cpp + qpid/log/posix/SinkOptions.cpp + qpid/sys/posix/Socket.cpp + qpid/sys/posix/StrError.cpp + qpid/sys/posix/SystemInfo.cpp + qpid/sys/posix/Thread.cpp + qpid/sys/posix/Time.cpp + + ${qpid_poller_module} + ) + set (libqpidcommon_platform_LIBS + boost_program_options + boost_filesystem + uuid + ${CMAKE_DL_LIBS} + ) + + set (libqpidbroker_platform_SOURCES + qpid/broker/Daemon.cpp + qpid/broker/SaslAuthenticator.cpp + qpid/broker/SignalHandler.h + qpid/broker/SignalHandler.cpp + qpid/broker/posix/BrokerDefaults.cpp + ) + + set (libqpidclient_platform_SOURCES + qpid/client/SaslFactory.cpp + ) + + set (qpidd_platform_SOURCES + posix/QpiddBroker.cpp + ) +endif (CMAKE_SYSTEM_NAME STREQUAL Windows) + +set (libqpidcommon_SOURCES + ${rgen_framing_srcs} + ${libqpidcommon_platform_SOURCES} + ${qpidcommon_sasl_source} + qpid/assert.cpp + qpid/Address.cpp + qpid/DataDir.cpp + qpid/Exception.cpp + qpid/Modules.cpp + qpid/Options.cpp + qpid/Plugin.cpp + qpid/RefCountedBuffer.cpp + qpid/SessionState.cpp + qpid/SessionId.cpp + qpid/StringUtils.cpp + qpid/Url.cpp + qpid/amqp_0_10/SessionHandler.cpp + qpid/framing/AccumulatedAck.cpp + qpid/framing/AMQBody.cpp + qpid/framing/AMQMethodBody.cpp + qpid/framing/AMQContentBody.cpp + qpid/framing/AMQFrame.cpp + qpid/framing/AMQHeaderBody.cpp + qpid/framing/AMQHeartbeatBody.cpp + qpid/framing/Array.cpp + qpid/framing/BodyHolder.cpp + qpid/framing/BodyHandler.cpp + qpid/framing/Buffer.cpp + qpid/framing/Endian.cpp + qpid/framing/FieldTable.cpp + qpid/framing/FieldValue.cpp + qpid/framing/FrameSet.cpp + qpid/framing/FrameDecoder.cpp + qpid/framing/ProtocolInitiation.cpp + qpid/framing/ProtocolVersion.cpp + qpid/framing/SendContent.cpp + qpid/framing/SequenceNumber.cpp + qpid/framing/SequenceNumberSet.cpp + qpid/framing/SequenceSet.cpp + qpid/framing/Proxy.cpp + qpid/framing/Uuid.cpp + qpid/framing/TransferContent.cpp + qpid/log/Logger.cpp + qpid/log/Options.cpp + qpid/log/OstreamOutput.cpp + qpid/log/Selector.cpp + qpid/log/Statement.cpp + qpid/management/Manageable.cpp + qpid/management/ManagementObject.cpp + qpid/sys/AggregateOutput.cpp + qpid/sys/AsynchIOHandler.cpp + qpid/sys/Dispatcher.cpp + qpid/sys/DispatchHandle.cpp + qpid/sys/Runnable.cpp + qpid/sys/Shlib.cpp + qpid/sys/Timer.cpp +) +add_library (qpidcommon SHARED ${libqpidcommon_SOURCES}) +if (CLOCK_GETTIME_IN_RT) + set (libqpidcommon_platform_LIBS ${libqpidcommon_platform_LIBS} rt) +endif (CLOCK_GETTIME_IN_RT) +target_link_libraries (qpidcommon + ${libqpidcommon_platform_LIBS} + ${qpidcommon_sasl_lib}) +set_target_properties (qpidcommon PROPERTIES + VERSION ${qpidc_version}) + +set (libqpidclient_SOURCES + ${rgen_client_srcs} + ${libqpidclient_platform_SOURCES} + qpid/client/Bounds.cpp + qpid/client/Completion.cpp + qpid/client/Connection.cpp + qpid/client/ConnectionHandler.cpp + qpid/client/ConnectionImpl.cpp + qpid/client/ConnectionSettings.cpp + qpid/client/Connector.cpp + qpid/client/Demux.cpp + qpid/client/Dispatcher.cpp + qpid/client/FailoverManager.cpp + qpid/client/FailoverListener.h + qpid/client/FailoverListener.cpp + qpid/client/Future.cpp + qpid/client/FutureCompletion.cpp + qpid/client/FutureResult.cpp + qpid/client/HandlePrivate.h + qpid/client/LoadPlugins.cpp + qpid/client/LocalQueue.cpp + qpid/client/Message.cpp + qpid/client/MessageImpl.cpp + qpid/client/MessageListener.cpp + qpid/client/MessageReplayTracker.cpp + qpid/client/QueueOptions.cpp + qpid/client/Results.cpp + qpid/client/SessionBase_0_10.cpp + qpid/client/SessionBase_0_10.h + qpid/client/SessionBase_0_10Access.h + qpid/client/ConnectionAccess.h + qpid/client/SessionImpl.cpp + qpid/client/StateManager.cpp + qpid/client/Subscription.cpp + qpid/client/SubscriptionImpl.cpp + qpid/client/SubscriptionManager.cpp +) +add_library (qpidclient SHARED ${libqpidclient_SOURCES}) +target_link_libraries (qpidclient qpidcommon) +set_target_properties (qpidclient PROPERTIES VERSION ${qpidc_version}) + +set (libqpidbroker_SOURCES + ${mgen_broker_cpp} + ${libqpidbroker_platform_SOURCES} + qpid/amqp_0_10/Connection.h + qpid/amqp_0_10/Connection.cpp + qpid/broker/Broker.cpp + qpid/broker/BrokerSingleton.cpp + qpid/broker/Exchange.cpp + qpid/broker/ExpiryPolicy.cpp + qpid/broker/Queue.cpp + qpid/broker/QueueCleaner.cpp + qpid/broker/QueueListeners.cpp + qpid/broker/PersistableMessage.cpp + qpid/broker/Bridge.cpp + qpid/broker/Connection.cpp + qpid/broker/ConnectionHandler.cpp + qpid/broker/ConnectionFactory.cpp + qpid/broker/DeliverableMessage.cpp + qpid/broker/DeliveryRecord.cpp + qpid/broker/DirectExchange.cpp + qpid/broker/DtxAck.cpp + qpid/broker/DtxBuffer.cpp + qpid/broker/DtxManager.cpp + qpid/broker/DtxTimeout.cpp + qpid/broker/DtxWorkRecord.cpp + qpid/broker/ExchangeRegistry.cpp + qpid/broker/FanOutExchange.cpp + qpid/broker/HeadersExchange.cpp + qpid/broker/IncompleteMessageList.cpp + qpid/broker/Link.cpp + qpid/broker/LinkRegistry.cpp + qpid/broker/Message.cpp + qpid/broker/MessageAdapter.cpp + qpid/broker/MessageBuilder.cpp + qpid/broker/MessageStoreModule.cpp + qpid/broker/NameGenerator.cpp + qpid/broker/NullMessageStore.cpp + qpid/broker/QueueBindings.cpp + qpid/broker/QueueEvents.cpp + qpid/broker/QueuePolicy.cpp + qpid/broker/QueueRegistry.cpp + qpid/broker/RateTracker.cpp + qpid/broker/RecoveryManagerImpl.cpp + qpid/broker/RecoveredEnqueue.cpp + qpid/broker/RecoveredDequeue.cpp + qpid/broker/RetryList.cpp + qpid/broker/SecureConnection.cpp + qpid/broker/SecureConnectionFactory.cpp + qpid/broker/SemanticState.h + qpid/broker/SemanticState.cpp + qpid/broker/SessionAdapter.cpp + qpid/broker/SessionState.h + qpid/broker/SessionState.cpp + qpid/broker/SessionManager.h + qpid/broker/SessionManager.cpp + qpid/broker/SessionContext.h + qpid/broker/SessionHandler.h + qpid/broker/SessionHandler.cpp + qpid/broker/System.cpp + qpid/broker/Timer.cpp + qpid/broker/TopicExchange.cpp + qpid/broker/TxAccept.cpp + qpid/broker/TxBuffer.cpp + qpid/broker/TxPublish.cpp + qpid/broker/Vhost.cpp + qpid/management/ManagementBroker.cpp + qpid/management/ManagementExchange.cpp + qpid/sys/TCPIOPlugin.cpp +) +add_library (qpidbroker SHARED ${libqpidbroker_SOURCES}) +target_link_libraries (qpidbroker qpidcommon) +set_target_properties (qpidbroker PROPERTIES VERSION ${qpidc_version}) +if (MSVC) + set_target_properties (qpidbroker PROPERTIES COMPILE_FLAGS /wd4290) +endif (MSVC) + +set (qpidd_SOURCES + ${qpidd_platform_SOURCES} + qpidd.cpp + qpidd.h +) +add_executable (qpidd ${qpidd_SOURCES}) +target_link_libraries (qpidd qpidbroker qpidcommon) + +# QMF agent library +#module_hdr += \ +# qpid/agent/ManagementAgent.h \ +# qpid/agent/ManagementAgentImpl.h +set (qmfagent_SOURCES + qpid/agent/ManagementAgent.h + qpid/agent/ManagementAgentImpl.cpp + qpid/agent/ManagementAgentImpl.h + ) +add_library (qmfagent SHARED ${qmfagent_SOURCES}) +target_link_libraries (qmfagent qpidclient) +set_target_properties (qmfagent PROPERTIES + VERSION ${qpidc_version}) + +# QMF console library +#module_hdr += \ +# qpid/console/Agent.h \ +# qpid/console/Broker.h \ +# qpid/console/ClassKey.h \ +# qpid/console/ConsoleImportExport.h \ +# qpid/console/ConsoleListener.h \ +# qpid/console/Event.h \ +# qpid/console/Object.h \ +# qpid/console/ObjectId.h \ +# qpid/console/Package.h \ +# qpid/console/Schema.h \ +# qpid/console/SequenceManager.h \ +# qpid/console/SessionManager.h \ +# qpid/console/Value.h +set (qmfconsole_SOURCES + qpid/console/Agent.h + qpid/console/Agent.cpp + qpid/console/Broker.h + qpid/console/Broker.cpp + qpid/console/ClassKey.h + qpid/console/ClassKey.cpp + qpid/console/ConsoleImportExport.h + qpid/console/ConsoleListener.h + qpid/console/Event.h + qpid/console/Event.cpp + qpid/console/Object.h + qpid/console/Object.cpp + qpid/console/ObjectId.h + qpid/console/ObjectId.cpp + qpid/console/Package.h + qpid/console/Package.cpp + qpid/console/Schema.h + qpid/console/Schema.cpp + qpid/console/SequenceManager.h + qpid/console/SequenceManager.cpp + qpid/console/SessionManager.h + qpid/console/SessionManager.cpp + qpid/console/Value.h + qpid/console/Value.cpp + ) +add_library (qmfconsole SHARED ${qmfconsole_SOURCES}) +target_link_libraries (qmfconsole qpidclient) +set_target_properties (qmfconsole PROPERTIES + VERSION ${qpidc_version}) + +# A queue event listener plugin that creates messages on a replication +# queue corresponding to enqueue and dequeue events: +add_library (replicating_listener SHARED + qpid/replication/constants.h + qpid/replication/ReplicatingEventListener.cpp + qpid/replication/ReplicatingEventListener.h + ) +target_link_libraries (replicating_listener qpidbroker) +set_target_properties (replicating_listener PROPERTIES + VERSION ${qpidc_version}) +if (CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(replicating_listener PROPERTIES + LINK_FLAGS -Wl,--no-undefined) +endif (CMAKE_COMPILER_IS_GNUCXX) + +# A custom exchange plugin that allows an exchange to be created that +# can process the messages from a replication queue (populated on the +# source system by the replicating listener plugin above) and take the +# corresponding action on the local queues +add_library (replicating_exchange SHARED + qpid/replication/constants.h + qpid/replication/ReplicationExchange.cpp + qpid/replication/ReplicationExchange.h + ) +target_link_libraries (replicating_exchange qpidbroker) +set_target_properties (replicating_exchange PROPERTIES + VERSION ${qpidc_version}) +if (CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(replicating_exchange PROPERTIES + LINK_FLAGS -Wl,--no-undefined) +endif (CMAKE_COMPILER_IS_GNUCXX) + +# This is only really needed until all the trunk builds (Linux, UNIX, Windows) +# are all on cmake only. This is because cmake builds always have a config.h +# file whereas older builds only have config.h on autoconf-generated builds. +add_definitions(-DHAVE_CONFIG_H) + +# Now create the config file from all the info learned above. +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/config.h) + +# add_subdirectory(tests) diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am index ce6debd4d2..457463e72d 100644 --- a/cpp/src/Makefile.am +++ b/cpp/src/Makefile.am @@ -106,8 +106,8 @@ AM_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO_ARG) INCLUDES = -Igen -I$(srcdir)/gen ## Automake macros to build libraries and executables. -qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DMODULE_DIR=\"$(dmoduledir)\" -DCONF_FILE=\"$(sysconfdir)/qpidd.conf\" -libqpidclient_la_CXXFLAGS = $(AM_CXXFLAGS) -DMODULE_DIR=\"$(cmoduledir)\" -DCONF_FILE=\"$(confdir)/qpidc.conf\" +qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDD_MODULE_DIR=\"$(dmoduledir)\" -DQPIDD_CONF_FILE=\"$(sysconfdir)/qpidd.conf\" +libqpidclient_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_MODULE_DIR=\"$(cmoduledir)\" -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\" qpidd_LDADD = \ libqpidbroker.la \ diff --git a/cpp/src/cluster.cmake b/cpp/src/cluster.cmake new file mode 100644 index 0000000000..5d7c4380b6 --- /dev/null +++ b/cpp/src/cluster.cmake @@ -0,0 +1,119 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# +# Cluster library CMake fragment, to be included in CMakeLists.txt +# + +# Optional cluster support. Requires CPG; if building it, can optionally +# include CMAN support as well. + +include(CheckIncludeFiles) +include(CheckLibraryExists) + +if (CMAKE_SYSTEM_NAME STREQUAL Windows) + set (cluster_default OFF) +else (CMAKE_SYSTEM_NAME STREQUAL Windows) + set (cluster_default ON) +endif (CMAKE_SYSTEM_NAME STREQUAL Windows) + +option(BUILD_CPG "Build with CPG support for clustering" ${cluster_default}) +if (BUILD_CPG) + CHECK_LIBRARY_EXISTS (cpg cpg_local_get + "-L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync" + HAVE_LIBCPG) + CHECK_INCLUDE_FILES (openais/cpg.h HAVE_OPENAIS_CPG_H) + CHECK_INCLUDE_FILES (corosync/cpg.h HAVE_COROSYNC_CPG_H) + if (NOT HAVE_LIBCPG) + message(FATAL_ERROR "libcpg not found, install openais-devel or corosync-devel") + endif (NOT HAVE_LIBCPG) + if (NOT HAVE_OPENAIS_CPG_H AND NOT HAVE_COROSYNC_CPG_H) + message(FATAL_ERROR "cpg.h not found, install openais-devel or corosync-devel") + endif (NOT HAVE_OPENAIS_CPG_H AND NOT HAVE_COROSYNC_CPG_H) + + option(CPG_INCLUDE_CMAN "Include libcman quorum service integration" ON) + if (CPG_INCLUDE_CMAN) + CHECK_LIBRARY_EXISTS (cman cman_is_quorate "" HAVE_LIBCMAN) + CHECK_INCLUDE_FILES (libcman.h HAVE_LIBCMAN_H) + if (NOT HAVE_LIBCMAN) + message(FATAL_ERROR "libcman not found, install cman-devel or cmanlib-devel") + endif (NOT HAVE_LIBCMAN) + if (NOT HAVE_LIBCMAN_H) + message(FATAL_ERROR "libcman.h not found, install cman-devel or cmanlib-devel") + endif (NOT HAVE_LIBCMAN_H) + + set (CMAN_SOURCES qpid/cluster/Quorum_cman.h qpid/cluster/Quorum_cman.cpp) + set (CMAN_LIB cman) + else (CPG_INCLUDE_CMAN) + set (CMAN_SOURCES qpid/cluster/Quorum_null.h) + endif (CPG_INCLUDE_CMAN) + + set (cluster_SOURCES + ${CMAN_SOURCES} + qpid/cluster/Cluster.cpp + qpid/cluster/Cluster.h + qpid/cluster/Decoder.cpp + qpid/cluster/Decoder.h + qpid/cluster/PollableQueue.h + qpid/cluster/ClusterMap.cpp + qpid/cluster/ClusterMap.h + qpid/cluster/ClusterPlugin.cpp + qpid/cluster/ClusterSettings.h + qpid/cluster/Connection.cpp + qpid/cluster/Connection.h + qpid/cluster/ConnectionCodec.cpp + qpid/cluster/ConnectionCodec.h + qpid/cluster/Cpg.cpp + qpid/cluster/Cpg.h + qpid/cluster/Dispatchable.h + qpid/cluster/UpdateClient.cpp + qpid/cluster/UpdateClient.h + qpid/cluster/Event.cpp + qpid/cluster/Event.h + qpid/cluster/EventFrame.h + qpid/cluster/EventFrame.cpp + qpid/cluster/ExpiryPolicy.h + qpid/cluster/ExpiryPolicy.cpp + qpid/cluster/FailoverExchange.cpp + qpid/cluster/FailoverExchange.h + qpid/cluster/UpdateExchange.h + qpid/cluster/LockedConnectionMap.h + qpid/cluster/Multicaster.cpp + qpid/cluster/Multicaster.h + qpid/cluster/McastFrameHandler.h + qpid/cluster/NoOpConnectionOutputHandler.h + qpid/cluster/OutputInterceptor.cpp + qpid/cluster/OutputInterceptor.h + qpid/cluster/PollerDispatch.cpp + qpid/cluster/PollerDispatch.h + qpid/cluster/ProxyInputHandler.h + qpid/cluster/Quorum.h + qpid/cluster/WriteEstimate.cpp + qpid/cluster/WriteEstimate.h + qpid/cluster/types.h + ) + + add_library (cluster SHARED ${cluster_SOURCES}) + target_link_libraries (cluster cpg ${CMAN_LIB} qpidbroker qpidclient) +#cluster_la_LDFLAGS = $(PLUGINLDFLAGS) + set_target_properties (cluster PROPERTIES VERSION ${qpidc_version}) + +endif (BUILD_CPG) + +# Distribute all sources. +#EXTRA_DIST += qpid/cluster/Quorum_cman.h qpid/cluster/Quorum_cman.cpp qpid/cluster/Quorum_null.h diff --git a/cpp/src/config.h.cmake b/cpp/src/config.h.cmake new file mode 100644 index 0000000000..69e6523c92 --- /dev/null +++ b/cpp/src/config.h.cmake @@ -0,0 +1,51 @@ +/* + * + * Copyright (c) 2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/* + * This file is automatically generated and will be overwritten by the + * next CMake invocation. + */ + +#ifndef QPID_CONFIG_H +#define QPID_CONFIG_H + +// PACKAGE_NAME and PACKAGE_VERSION are carry-overs from the autoconf world. +// They tend to cause confusion and problems when mixing headers from multiple +// autoconf-configured packages, so it's best to remove these in favor of +// Qpid-specific names as soon as the autoconf stuff is removed. +#define PACKAGE_NAME "${CMAKE_PROJECT_NAME}" +#define PACKAGE_VERSION "${qpidc_version}" + +#cmakedefine QPIDC_CONF_FILE "${QPIDC_CONF_FILE}" +#cmakedefine QPIDD_CONF_FILE "${QPIDD_CONF_FILE}" + +#cmakedefine QPIDC_MODULE_DIR "${QPIDC_MODULE_DIR}" +#cmakedefine QPIDD_MODULE_DIR "${QPIDD_MODULE_DIR}" + +#cmakedefine QPID_HAS_CLOCK_GETTIME + +#cmakedefine QPID_HAS_SASL +#cmakedefine BROKER_SASL_NAME "${BROKER_SASL_NAME}" +#ifdef QPID_HAS_SASL +# define HAVE_SASL 1 +#endif + +#cmakedefine HAVE_LOG_AUTHPRIV +#cmakedefine HAVE_LOG_FTP + +#endif /* QPID_CONFIG_H */ diff --git a/cpp/src/posix/QpiddBroker.cpp b/cpp/src/posix/QpiddBroker.cpp index ba1ef640df..aa934571be 100644 --- a/cpp/src/posix/QpiddBroker.cpp +++ b/cpp/src/posix/QpiddBroker.cpp @@ -18,6 +18,7 @@ * */ +#include "config.h" #include "qpidd.h" #include "qpid/Exception.h" #include "qpid/broker/Broker.h" @@ -37,8 +38,8 @@ using qpid::broker::Daemon; BootstrapOptions::BootstrapOptions(const char* argv0) : qpid::Options("Options"), - common("", CONF_FILE), - module(MODULE_DIR), + common("", QPIDD_CONF_FILE), + module(QPIDD_MODULE_DIR), log(argv0) { add(common); @@ -89,8 +90,8 @@ struct QpiddPosixOptions : public QpiddOptionsPrivate { QpiddOptions::QpiddOptions(const char* argv0) : qpid::Options("Options"), - common("", CONF_FILE), - module(MODULE_DIR), + common("", QPIDD_CONF_FILE), + module(QPIDD_MODULE_DIR), log(argv0) { add(common); diff --git a/cpp/src/qpid/CommonImportExport.h b/cpp/src/qpid/CommonImportExport.h index 47872646d9..02c06ed7af 100644 --- a/cpp/src/qpid/CommonImportExport.h +++ b/cpp/src/qpid/CommonImportExport.h @@ -21,7 +21,7 @@ */ #if defined(WIN32) && !defined(QPID_DECLARE_STATIC) -#if defined(COMMON_EXPORT) +#if defined(COMMON_EXPORT) || defined (qpidcommon_EXPORTS) #define QPID_COMMON_EXTERN __declspec(dllexport) #else #define QPID_COMMON_EXTERN __declspec(dllimport) diff --git a/cpp/src/qpid/broker/BrokerImportExport.h b/cpp/src/qpid/broker/BrokerImportExport.h index 2edc90993e..4edf8c9844 100644 --- a/cpp/src/qpid/broker/BrokerImportExport.h +++ b/cpp/src/qpid/broker/BrokerImportExport.h @@ -21,7 +21,7 @@ */ #if defined(WIN32) && !defined(QPID_BROKER_STATIC) -#if defined(BROKER_EXPORT) +#if defined(BROKER_EXPORT) || defined (qpidbroker_EXPORTS) #define QPID_BROKER_EXTERN __declspec(dllexport) #else #define QPID_BROKER_EXTERN __declspec(dllimport) diff --git a/cpp/src/qpid/client/ClientImportExport.h b/cpp/src/qpid/client/ClientImportExport.h index 0e6e5660d6..3b311655ab 100644 --- a/cpp/src/qpid/client/ClientImportExport.h +++ b/cpp/src/qpid/client/ClientImportExport.h @@ -21,7 +21,7 @@ */ #if defined(WIN32) && !defined(QPID_DECLARE_STATIC) -#if defined(CLIENT_EXPORT) +#if defined(CLIENT_EXPORT) || defined (qpidclient_EXPORTS) #define QPID_CLIENT_EXTERN __declspec(dllexport) #else #define QPID_CLIENT_EXTERN __declspec(dllimport) diff --git a/cpp/src/qpid/client/LoadPlugins.cpp b/cpp/src/qpid/client/LoadPlugins.cpp index b395226859..eca6aa47fc 100644 --- a/cpp/src/qpid/client/LoadPlugins.cpp +++ b/cpp/src/qpid/client/LoadPlugins.cpp @@ -19,6 +19,7 @@ * */ +#include "config.h" #include "qpid/Modules.h" #include "qpid/sys/Shlib.h" #include <string> @@ -30,9 +31,9 @@ namespace { struct LoadtimeInitialise { LoadtimeInitialise() { - qpid::ModuleOptions moduleOptions(MODULE_DIR); + qpid::ModuleOptions moduleOptions(QPIDC_MODULE_DIR); string defaultPath (moduleOptions.loadDir); - moduleOptions.parse (0, 0, CONF_FILE, true); + moduleOptions.parse (0, 0, QPIDC_CONF_FILE, true); for (vector<string>::iterator iter = moduleOptions.load.begin(); iter != moduleOptions.load.end(); diff --git a/cpp/src/qpid/client/SslConnector.cpp b/cpp/src/qpid/client/SslConnector.cpp index a4298dd4ca..7b0bcc6f1e 100644 --- a/cpp/src/qpid/client/SslConnector.cpp +++ b/cpp/src/qpid/client/SslConnector.cpp @@ -20,6 +20,7 @@ */ #include "Connector.h" +#include "config.h" #include "Bounds.h" #include "ConnectionImpl.h" #include "ConnectionSettings.h" @@ -146,7 +147,7 @@ namespace { StaticInit() { try { SslOptions options; - options.parse (0, 0, CONF_FILE, true); + options.parse (0, 0, QPIDC_CONF_FILE, true); if (options.certDbPath.empty()) { QPID_LOG(info, "SSL connector not enabled, you must set QPID_SSL_CERT_DB to enable it."); } else { diff --git a/cpp/src/rdma.cmake b/cpp/src/rdma.cmake new file mode 100644 index 0000000000..a48329a6d5 --- /dev/null +++ b/cpp/src/rdma.cmake @@ -0,0 +1,94 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# +# RDMA (Remote DMA) wrapper CMake fragment, to be included in CMakeLists.txt +# + +# Optional RDMA support. Requires ibverbs and rdma_cm. + +include(CheckIncludeFiles) +include(CheckLibraryExists) + +option(BUILD_RDMA "Build with support for Remote DMA protocols" OFF) +if (BUILD_RDMA) + CHECK_LIBRARY_EXISTS (ibverbs ibv_create_qp "" HAVE_IBVERBS) + CHECK_LIBRARY_EXISTS (rdmacm rdma_create_id "" HAVE_RDMACM) + CHECK_INCLUDE_FILES (infiniband/verbs.h HAVE_IBVERBS_H) + CHECK_INCLUDE_FILES (rdma/rdma_cma.h HAVE_RDMACM_H) + if (NOT HAVE_IBVERBS) + message(FATAL_ERROR "libibverbs not found, required for RDMA support") + endif (NOT HAVE_IBVERBS) + if (NOT HAVE_RDMACM) + message(FATAL_ERROR "librdmacm not found, required for RDMA support") + endif (NOT HAVE_RDMACM) + if (NOT HAVE_IBVERBS_H) + message(FATAL_ERROR "ibverbs headers not found, required for RDMA support") + endif (NOT HAVE_IBVERBS_H) + if (NOT HAVE_RDMACM_H) + message(FATAL_ERROR "rdmacm headers not found, required for RDMA support") + endif (NOT HAVE_RDMACM_H) + + set (rdma_SOURCES + qpid/sys/rdma/rdma_exception.h + qpid/sys/rdma/rdma_factories.cpp + qpid/sys/rdma/rdma_factories.h + qpid/sys/rdma/RdmaIO.cpp + qpid/sys/rdma/RdmaIO.h + qpid/sys/rdma/rdma_wrap.cpp + qpid/sys/rdma/rdma_wrap.h + ) + + add_library (rdmawrap SHARED ${rdma_SOURCES}) + target_link_libraries (rdmawrap qpidcommon rdmacm ibverbs) + set_target_properties (rdmawrap PROPERTIES VERSION ${qpidc_version}) + if (CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(rdmawrap PROPERTIES + COMPILE_FLAGS -Wno-missing-field-initializers + LINK_FLAGS -Wl,--no-undefined) + endif (CMAKE_COMPILER_IS_GNUCXX) + + add_library (rdma SHARED qpid/sys/RdmaIOPlugin.cpp) + target_link_libraries (rdma qpidbroker rdmawrap) + set_target_properties (rdma PROPERTIES VERSION ${qpidc_version}) + if (CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(rdmawrap PROPERTIES + COMPILE_FLAGS -Wno-missing-field-initializers + LINK_FLAGS -Wl,--no-undefined) + endif (CMAKE_COMPILER_IS_GNUCXX) + + add_library (rdmaconnector SHARED qpid/client/RdmaConnector.cpp) + target_link_libraries (rdmaconnector qpidclient rdmawrap) + set_target_properties (rdmaconnector PROPERTIES VERSION ${qpidc_version}) + if (CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(rdmaconnector PROPERTIES + COMPILE_FLAGS -Wno-missing-field-initializers + LINK_FLAGS -Wl,--no-undefined) + endif (CMAKE_COMPILER_IS_GNUCXX) + + # RDMA test/sample programs + add_executable (RdmaServer qpid/sys/rdma/RdmaServer.cpp) + target_link_libraries (RdmaServer rdmawrap qpidcommon) + add_executable (RdmaClient qpid/sys/rdma/RdmaClient.cpp) + target_link_libraries (RdmaClient rdmawrap qpidcommon) + if (CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(RdmaClient PROPERTIES + COMPILE_FLAGS -Wno-missing-field-initializers) + endif (CMAKE_COMPILER_IS_GNUCXX) + +endif (BUILD_RDMA) diff --git a/cpp/src/ssl.cmake b/cpp/src/ssl.cmake new file mode 100644 index 0000000000..765ed3fdcf --- /dev/null +++ b/cpp/src/ssl.cmake @@ -0,0 +1,105 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# +# SSL/TLS CMake fragment, to be included in CMakeLists.txt +# + +# Optional SSL/TLS support. Requires Netscape Portable Runtime on Linux. + +include(FindPkgConfig) + +if (CMAKE_SYSTEM_NAME STREQUAL Windows) + set (ssl_default OFF) +else (CMAKE_SYSTEM_NAME STREQUAL Windows) + set (ssl_default ON) +endif (CMAKE_SYSTEM_NAME STREQUAL Windows) + +option(BUILD_SSL "Build with support for SSL" ${ssl_default}) +if (BUILD_SSL) + find_program (NSPR_CONFIG nspr-config) + if (NSPR_CONFIG STREQUAL NSPR_CONFIG-NOTFOUND) + message(FATAL_ERROR "libnspr not found, required for SSL support") + endif (NSPR_CONFIG STREQUAL NSPR_CONFIG-NOTFOUND) + find_program (NSS_CONFIG nss-config) + if (NSS_CONFIG STREQUAL NSS_CONFIG-NOTFOUND) + message(FATAL_ERROR "libnss not found, required for SSL support") + endif (NSS_CONFIG STREQUAL NSS_CONFIG-NOTFOUND) + # Output from nss/snpr-config ends with newline, so strip it + # Also, sometimes there's no need for additional -I options (or -L) but + # the -I is included anyway; in these cases, ignore it. + execute_process (COMMAND ${NSPR_CONFIG} --cflags + OUTPUT_VARIABLE get_flags) + string (STRIP ${get_flags} NSPR_CFLAGS) + if (NSPR_CFLAGS STREQUAL -I) + set (NSPR_CFLAGS ) + endif (NSPR_CFLAGS STREQUAL -I) + execute_process (COMMAND ${NSPR_CONFIG} --libs + OUTPUT_VARIABLE get_flags) + string (STRIP ${get_flags} NSPR_LIBS) + execute_process (COMMAND ${NSS_CONFIG} --cflags + OUTPUT_VARIABLE get_flags) + string (STRIP ${get_flags} NSS_CFLAGS) + if (NSS_CFLAGS STREQUAL -I) + set (NSS_CFLAGS ) + endif (NSS_CFLAGS STREQUAL -I) + execute_process (COMMAND ${NSS_CONFIG} --libs + OUTPUT_VARIABLE get_flags) + string (STRIP ${get_flags} NSS_LIBS) + + set (sslcommon_SOURCES + qpid/sys/ssl/check.h + qpid/sys/ssl/check.cpp + qpid/sys/ssl/util.h + qpid/sys/ssl/util.cpp + qpid/sys/ssl/SslSocket.h + qpid/sys/ssl/SslSocket.cpp + qpid/sys/ssl/SslIo.h + qpid/sys/ssl/SslIo.cpp + ) + + add_library (sslcommon SHARED ${sslcommon_SOURCES}) + target_link_libraries (sslcommon qpidcommon nss3 ssl3 nspr4) + set_target_properties (sslcommon PROPERTIES + VERSION ${qpidc_version} + COMPILE_FLAGS "${NSPR_CFLAGS} ${NSS_CFLAGS}") + + set (ssl_SOURCES + qpid/sys/SslPlugin.cpp + qpid/sys/ssl/SslHandler.h + qpid/sys/ssl/SslHandler.cpp + ) + add_library (ssl SHARED ${ssl_SOURCES}) + target_link_libraries (ssl qpidbroker sslcommon) + set_target_properties (ssl PROPERTIES + VERSION ${qpidc_version} + COMPILE_FLAGS "${NSPR_CFLAGS} ${NSS_CFLAGS}") + if (CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(ssl PROPERTIES + LINK_FLAGS -Wl,--no-undefined) + endif (CMAKE_COMPILER_IS_GNUCXX) + + add_library (sslconnector SHARED qpid/client/SslConnector.cpp) + target_link_libraries (sslconnector qpidclient sslcommon) + set_target_properties (sslconnector PROPERTIES VERSION ${qpidc_version}) + if (CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(sslconnector PROPERTIES + LINK_FLAGS -Wl,--no-undefined) + endif (CMAKE_COMPILER_IS_GNUCXX) + +endif (BUILD_SSL) diff --git a/cpp/src/ssl.mk b/cpp/src/ssl.mk index 5b0ef3d8ae..fa94814f75 100644 --- a/cpp/src/ssl.mk +++ b/cpp/src/ssl.mk @@ -56,7 +56,7 @@ sslconnector_la_LIBADD = \ libqpidclient.la \ libsslcommon.la -sslconnector_la_CXXFLAGS = $(AM_CXXFLAGS) -DCONF_FILE=\"$(confdir)/qpidc.conf\" +sslconnector_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\" sslconnector_la_LDFLAGS = $(PLUGINLDFLAGS) diff --git a/cpp/src/tests/CMakeLists.txt b/cpp/src/tests/CMakeLists.txt new file mode 100644 index 0000000000..273231f0df --- /dev/null +++ b/cpp/src/tests/CMakeLists.txt @@ -0,0 +1,253 @@ + +########### install files ############### + + + + +#original Makefile.am contents follow: + +## +## Licensed to the Apache Software Foundation (ASF) under one +## or more contributor license agreements. See the NOTICE file +## distributed with this work for additional information +## regarding copyright ownership. The ASF licenses this file +## to you under the Apache License, Version 2.0 (the +## "License"); you may not use this file except in compliance +## with the License. You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, +## software distributed under the License is distributed on an +## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +## KIND, either express or implied. See the License for the +## specific language governing permissions and limitations +## under the License. +## +# +#AM_CXXFLAGS = $(WARNING_CFLAGS) -DBOOST_TEST_DYN_LINK +#INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../gen -I$(top_builddir)/src/gen +# +#abs_builddir=@abs_builddir@ +#extra_libs = +#lib_client = $(abs_builddir)/../libqpidclient.la +#lib_common = $(abs_builddir)/../libqpidcommon.la +#lib_broker = $(abs_builddir)/../libqpidbroker.la +#lib_console = $(abs_builddir)/../libqmfconsole.la +## lib_amqp_0_10 = $(abs_builddir)/../libqpidamqp_0_10.la +# +## +## Initialize variables that are incremented with += +## +#check_PROGRAMS= +#check_LTLIBRARIES= +#TESTS= +#EXTRA_DIST= +#CLEANFILES= +# +## +## Unit test program +## +## Unit tests are built as a single program to reduce valgrind overhead +## when running the tests. If you want to build a subset of the tests do +## rm -f unit_test; make unit_test unit_test_OBJECTS="unit_test.o SelectedTest.o" +## +# +#TESTS+=unit_test +#check_PROGRAMS+=unit_test +#unit_test_LDADD=-lboost_unit_test_framework -lboost_regex \ +# $(lib_client) $(lib_broker) $(lib_console) +# +#unit_test_SOURCES= unit_test.cpp unit_test.h \ +# BrokerFixture.h SocketProxy.h \ +# exception_test.cpp \ +# RefCounted.cpp \ +# SessionState.cpp Blob.cpp logging.cpp \ +# AsyncCompletion.cpp \ +# Url.cpp Uuid.cpp \ +# Shlib.cpp FieldValue.cpp FieldTable.cpp Array.cpp \ +# QueueOptionsTest.cpp \ +# InlineAllocator.cpp \ +# InlineVector.cpp \ +# ClientSessionTest.cpp \ +# SequenceSet.cpp \ +# StringUtils.cpp \ +# IncompleteMessageList.cpp \ +# RangeSet.cpp \ +# AtomicValue.cpp \ +# QueueTest.cpp \ +# AccumulatedAckTest.cpp \ +# DtxWorkRecordTest.cpp \ +# DeliveryRecordTest.cpp \ +# ExchangeTest.cpp \ +# HeadersExchangeTest.cpp \ +# MessageTest.cpp \ +# QueueRegistryTest.cpp \ +# QueuePolicyTest.cpp \ +# FramingTest.cpp \ +# HeaderTest.cpp \ +# SequenceNumberTest.cpp \ +# TimerTest.cpp \ +# TopicExchangeTest.cpp \ +# TxBufferTest.cpp \ +# TxPublishTest.cpp \ +# MessageBuilderTest.cpp \ +# ConnectionOptions.h \ +# ForkedBroker.h \ +# ManagementTest.cpp \ +# MessageReplayTracker.cpp \ +# ConsoleTest.cpp +# +#if HAVE_XML +#unit_test_SOURCES+= XmlClientSessionTest.cpp +#endif +# +# +## Disabled till we move to amqp_0_10 codec. +## amqp_0_10/serialize.cpp allSegmentTypes.h \ +## amqp_0_10/ProxyTemplate.cpp \ +## amqp_0_10/apply.cpp \ +## amqp_0_10/Map.cpp \ +## amqp_0_10/handlers.cpp +# +# +#check_LTLIBRARIES += libshlibtest.la +#libshlibtest_la_LDFLAGS = -module -rpath $(abs_builddir) +#libshlibtest_la_SOURCES = shlibtest.cpp +# +#include cluster.mk +#if SSL +#include ssl.mk +#endif +# +## +## Other test programs +## +#check_PROGRAMS+=perftest +#perftest_SOURCES=perftest.cpp test_tools.h TestOptions.h ConnectionOptions.h +#perftest_LDADD=$(lib_client) +# +#check_PROGRAMS+=txtest +#txtest_SOURCES=txtest.cpp TestOptions.h ConnectionOptions.h +#txtest_LDADD=$(lib_client) +# +#check_PROGRAMS+=latencytest +#latencytest_SOURCES=latencytest.cpp TestOptions.h ConnectionOptions.h +#latencytest_LDADD=$(lib_client) +# +#check_PROGRAMS+=echotest +#echotest_SOURCES=echotest.cpp TestOptions.h ConnectionOptions.h +#echotest_LDADD=$(lib_client) +# +#check_PROGRAMS+=client_test +#client_test_SOURCES=client_test.cpp TestOptions.h ConnectionOptions.h +#client_test_LDADD=$(lib_client) +# +#check_PROGRAMS+=topic_listener +#topic_listener_SOURCES=topic_listener.cpp TestOptions.h ConnectionOptions.h +#topic_listener_LDADD=$(lib_client) +# +#check_PROGRAMS+=topic_publisher +#topic_publisher_SOURCES=topic_publisher.cpp TestOptions.h ConnectionOptions.h +#topic_publisher_LDADD=$(lib_client) +# +#check_PROGRAMS+=publish +#publish_SOURCES=publish.cpp TestOptions.h ConnectionOptions.h +#publish_LDADD=$(lib_client) +# +#check_PROGRAMS+=consume +#consume_SOURCES=consume.cpp TestOptions.h ConnectionOptions.h +#consume_LDADD=$(lib_client) +# +#check_PROGRAMS+=header_test +#header_test_SOURCES=header_test.cpp TestOptions.h ConnectionOptions.h +#header_test_LDADD=$(lib_client) +# +#check_PROGRAMS+=failover_soak +#failover_soak_SOURCES=failover_soak.cpp ForkedBroker.h +#failover_soak_LDADD=$(lib_client) +# +#check_PROGRAMS+=declare_queues +#declare_queues_SOURCES=declare_queues.cpp +#declare_queues_LDADD=$(lib_client) +# +#check_PROGRAMS+=replaying_sender +#replaying_sender_SOURCES=replaying_sender.cpp +#replaying_sender_LDADD=$(lib_client) +# +#check_PROGRAMS+=resuming_receiver +#resuming_receiver_SOURCES=resuming_receiver.cpp +#resuming_receiver_LDADD=$(lib_client) +# +#check_PROGRAMS+=txshift +#txshift_SOURCES=txshift.cpp TestOptions.h ConnectionOptions.h +#txshift_LDADD=$(lib_client) +# +#check_PROGRAMS+=txjob +#txjob_SOURCES=txjob.cpp TestOptions.h ConnectionOptions.h +#txjob_LDADD=$(lib_client) +# +#check_PROGRAMS+=receiver +#receiver_SOURCES=receiver.cpp TestOptions.h ConnectionOptions.h +#receiver_LDADD=$(lib_client) +# +#check_PROGRAMS+=sender +#sender_SOURCES=sender.cpp TestOptions.h ConnectionOptions.h +#sender_LDADD=$(lib_client) +# +# +#TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir) QPID_DATA_DIR= BOOST_TEST_SHOW_PROGRESS=yes $(srcdir)/run_test +# +#system_tests = client_test quick_perftest quick_topictest run_header_test quick_txtest +#TESTS += start_broker $(system_tests) python_tests stop_broker run_federation_tests run_acl_tests +# +#EXTRA_DIST += \ +# run_test vg_check \ +# run-unit-tests start_broker python_tests stop_broker \ +# quick_topictest \ +# quick_perftest \ +# quick_txtest \ +# topictest \ +# run_header_test \ +# header_test.py \ +# ssl_test \ +# config.null \ +# ais_check \ +# run_federation_tests \ +# run_acl_tests \ +# .valgrind.supp \ +# MessageUtils.h \ +# TestMessageStore.h \ +# TxMocks.h \ +# start_cluster stop_cluster restart_cluster +# +#check_LTLIBRARIES += libdlclose_noop.la +#libdlclose_noop_la_LDFLAGS = -module -rpath $(abs_builddir) +#libdlclose_noop_la_SOURCES = dlclose_noop.c +# +#CLEANFILES+=valgrind.out *.log *.vglog* dummy_test $(unit_wrappers) +# +## FIXME aconway 2008-05-23: Disabled interop_runner because it uses +## the obsolete Channel class. Convert to Session and re-enable. +## +## check_PROGRAMS += interop_runner +# +## interop_runner_SOURCES = \ +## interop_runner.cpp \ +## SimpleTestCaseBase.cpp \ +## BasicP2PTest.cpp \ +## BasicPubSubTest.cpp \ +## SimpleTestCaseBase.h \ +## BasicP2PTest.h \ +## BasicPubSubTest.h \ +## TestCase.h \ +## TestOptions.h ConnectionOptions.h +## interop_runner_LDADD = $(lib_client) $(lib_common) $(extra_libs) +# +# +## Longer running stability tests, not run by default check: target. +## Not run under valgrind, too slow +#LONG_TESTS=fanout_perftest shared_perftest multiq_perftest topic_perftest run_failover_soak +#EXTRA_DIST+=$(LONG_TESTS) run_perftest +#check-long: +# $(MAKE) check TESTS="start_broker $(LONG_TESTS) stop_broker" VALGRIND= diff --git a/cpp/src/windows/QpiddBroker.cpp b/cpp/src/windows/QpiddBroker.cpp index 6714ac2e01..8694cefb04 100644 --- a/cpp/src/windows/QpiddBroker.cpp +++ b/cpp/src/windows/QpiddBroker.cpp @@ -19,6 +19,16 @@ * */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#else +// These need to be made something sensible, like reading a value from +// the registry. But for now, get things going with a local definition. +namespace { +const char *QPIDD_CONF_FILE = "qpid_broker.conf"; +const char *QPIDD_MODULE_DIR = "."; +} +#endif #include "qpidd.h" #include "qpid/Exception.h" #include "qpid/Options.h" @@ -29,19 +39,12 @@ #include <iostream> -// These need to be made something sensible, like reading a value from -// the registry. But for now, get things going with a local definition. -namespace { -const char *CONF_FILE = "qpid_broker.conf"; -const char *MODULE_DIR = "."; -} - using namespace qpid::broker; BootstrapOptions::BootstrapOptions(const char* argv0) : qpid::Options("Options"), - common("", CONF_FILE), - module(MODULE_DIR), + common("", QPIDD_CONF_FILE), + module(QPIDD_MODULE_DIR), log(argv0) { add(common); @@ -56,8 +59,8 @@ struct QpiddWindowsOptions : public QpiddOptionsPrivate { QpiddOptions::QpiddOptions(const char* argv0) : qpid::Options("Options"), - common("", CONF_FILE), - module(MODULE_DIR), + common("", QPIDD_CONF_FILE), + module(QPIDD_MODULE_DIR), log(argv0) { add(common); |