From 3c95f9a289fee6a3b43608ec2ac95f841c43e3ff Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Thu, 23 Apr 2009 22:59:12 +0000 Subject: 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 --- cpp/CMakeLists.txt | 40 ++ cpp/managementgen/CMakeLists.txt | 37 ++ cpp/managementgen/qmf-gen | 8 + cpp/managementgen/qmfgen/generate.py | 95 ++- .../qmfgen/templates/CMakeLists.cmake | 39 ++ cpp/rubygen/generate | 66 ++- cpp/src/CMakeLists.txt | 647 +++++++++++++++++++++ cpp/src/Makefile.am | 4 +- cpp/src/cluster.cmake | 119 ++++ cpp/src/config.h.cmake | 51 ++ cpp/src/posix/QpiddBroker.cpp | 9 +- cpp/src/qpid/CommonImportExport.h | 2 +- cpp/src/qpid/broker/BrokerImportExport.h | 2 +- cpp/src/qpid/client/ClientImportExport.h | 2 +- cpp/src/qpid/client/LoadPlugins.cpp | 5 +- cpp/src/qpid/client/SslConnector.cpp | 3 +- cpp/src/rdma.cmake | 94 +++ cpp/src/ssl.cmake | 105 ++++ cpp/src/ssl.mk | 2 +- cpp/src/tests/CMakeLists.txt | 253 ++++++++ cpp/src/windows/QpiddBroker.cpp | 25 +- 21 files changed, 1564 insertions(+), 44 deletions(-) create mode 100644 cpp/CMakeLists.txt create mode 100644 cpp/managementgen/CMakeLists.txt create mode 100644 cpp/managementgen/qmfgen/templates/CMakeLists.cmake create mode 100644 cpp/src/CMakeLists.txt create mode 100644 cpp/src/cluster.cmake create mode 100644 cpp/src/config.h.cmake create mode 100644 cpp/src/rdma.cmake create mode 100644 cpp/src/ssl.cmake create mode 100644 cpp/src/tests/CMakeLists.txt diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt new file mode 100644 index 0000000000..e17a93a1f1 --- /dev/null +++ b/cpp/CMakeLists.txt @@ -0,0 +1,40 @@ +# +# 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. +# +project(qpidc) +cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) +set (qpidc_version 0.5) + +# enable_testing() +# set(CMAKE_INCLUDE_CURRENT_DIR ON) + +add_subdirectory(managementgen) +# add_subdirectory(etc) +add_subdirectory(src) +# add_subdirectory(docs/api) +# add_subdirectory(docs/man) +#add_subdirectory(examples) + +# if (WIN32) +# do something Microsoft specific +# endif (WIN32) + + +install(FILES LICENSE NOTICE README SSL RELEASE_NOTES DESIGN + xml/cluster.xml INSTALL-WINDOWS + DESTINATION .) diff --git a/cpp/managementgen/CMakeLists.txt b/cpp/managementgen/CMakeLists.txt new file mode 100644 index 0000000000..fa0c3f2909 --- /dev/null +++ b/cpp/managementgen/CMakeLists.txt @@ -0,0 +1,37 @@ +# +# 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. +# +project(qpidc-qmfgen) +cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) + +install(PROGRAMS qmf-gen DESTINATION managementgen + COMPONENT all-source) +install(FILES qmfgen/__init__.py + qmfgen/generate.py + qmfgen/schema.py + qmfgen/templates/Args.h + qmfgen/templates/Class.cpp + qmfgen/templates/Class.h + qmfgen/templates/Event.cpp + qmfgen/templates/Event.h + qmfgen/templates/Makefile.mk + qmfgen/templates/Package.cpp + qmfgen/templates/Package.h + qmfgen/management-types.xml + DESTINATION managementgen + COMPONENT all-source) diff --git a/cpp/managementgen/qmf-gen b/cpp/managementgen/qmf-gen index f2efa109f3..c6cfca5f83 100755 --- a/cpp/managementgen/qmf-gen +++ b/cpp/managementgen/qmf-gen @@ -33,6 +33,8 @@ usage = "usage: %prog [options] schema-document..." parser = OptionParser(usage=usage) parser.add_option("-o", "--outputdir", dest="outputdir", metavar="DIR", default="./", help="Output directory") +parser.add_option("-c", "--cmakelists", dest="cmakelists", metavar="FILE", + help="CMakeLists fragment") parser.add_option("-m", "--makefile", dest="makefile", metavar="FILE", help="Makefile fragment") parser.add_option("-t", "--typefile", dest="typefile", metavar="FILE", default=defaultTypeFile, @@ -72,3 +74,9 @@ if opts.makefile != None: args["qpidbroker"] = opts.qpidbroker args["genprefix"] = opts.genprefix gen.makeSingleFile("Makefile.mk", opts.makefile, force=True, vars=args) + +if opts.cmakelists != None: + args = {} + args["qpidbroker"] = opts.qpidbroker + args["genprefix"] = opts.genprefix + gen.makeSingleFile("CMakeLists.cmake", opts.cmakelists, force=True, vars=args) diff --git a/cpp/managementgen/qmfgen/generate.py b/cpp/managementgen/qmfgen/generate.py index 35e222ebad..255d41ea0e 100755 --- a/cpp/managementgen/qmfgen/generate.py +++ b/cpp/managementgen/qmfgen/generate.py @@ -24,6 +24,7 @@ from errno import * import os import os.path import filecmp +import re class Template: """ @@ -175,6 +176,81 @@ class Makefile: return variables["qpidbroker"] return False +class CMakeLists(Makefile): + """ Object representing a makefile fragment """ + + # Regardless of what normalize() did, switch all the dir separators back + # to '/' - cmake expects that regardless of platform. + def unNormCase (self, path): + return re.sub("\\\\", "/", path) + + def genGenSources (self, stream, variables): + mdir = self.unNormCase(variables["mgenDir"]) + sdir = self.unNormCase(variables["specDir"]) + stream.write (mdir + "/qmf-gen \n") + stream.write (" " + mdir + "/qmfgen/generate.py\n") + stream.write (" " + mdir + "/qmfgen/schema.py\n") + stream.write (" " + mdir + "/qmfgen/management-types.xml\n") + stream.write (" " + sdir + "/management-schema.xml\n") + first = True + for template in self.templateFiles: + if first: + first = False + stream.write (" ") + else: + stream.write ("\n ") + stream.write (mdir + "/qmfgen/templates/" + template) + + def genGenCppFiles (self, stream, variables): + first = True + for file in self.filelists["cpp"]: + if first: + first = False + else: + stream.write (" \n ") + stream.write (self.unNormCase(file)) + + def genGenHFiles (self, stream, variables): + first = True + for file in self.filelists["h"]: + if first: + first = False + else: + stream.write (" \n ") + stream.write (self.unNormCase(file)) + + def genGeneratedFiles(self, stream, variables): + first = True + extensions = ("h", "cpp") + for ext in extensions: + for file in self.filelists[ext]: + if first: + first = False + else: + stream.write(" \n ") + if "genprefix" in variables: + prefix = variables["genprefix"] + if prefix != "": + stream.write(prefix + "/") + stream.write(self.unNormCase(file)) + + def genHeaderInstalls (self, stream, variables): + for package in self.packagelist: + stream.write("#Come back to this later...\n") + name = "_".join(package.split("/")) + stream.write("#" + name + "dir = $(includedir)/qmf/" + package + "\n") + stream.write("#dist_" + name + "_HEADERS = ") + first = True + for file in self.filelists["h"]: + file = self.unNormCase(file) + if file.find("gen/qmf/" + package) == 0: + if first: + first = False + else: + stream.write ("\n ") + stream.write("#" + file) + stream.write("\n\n") + class Generator: """ @@ -208,9 +284,10 @@ class Generator: self.input = self.normalize (templateDir) self.packagePath = self.dest self.filelists = {} - self.filelists["h"] = [] - self.filelists["cpp"] = [] - self.filelists["mk"] = [] + self.filelists["h"] = [] + self.filelists["cpp"] = [] + self.filelists["mk"] = [] + self.filelists["cmake"] = [] self.packagelist = [] self.templateFiles = [] self.variables = {} @@ -354,7 +431,17 @@ class Generator: def makeSingleFile (self, templateFile, target, force=False, vars=None): """ Generate a single expanded template """ - makefile = Makefile (self.filelists, self.templateFiles, self.packagelist) + dot = templateFile.find(".") + if dot == -1: + raise ValueError ("Invalid template file name %s" % templateFile) + className = templateFile[0:dot] + if className == "Makefile": + classType = Makefile + elif className == "CMakeLists": + classType = CMakeLists + else: + raise ValueError ("Invalid class name %s" % className) + makefile = classType (self.filelists, self.templateFiles, self.packagelist) template = Template (self.input + templateFile, self) if vars: for arg in vars: diff --git a/cpp/managementgen/qmfgen/templates/CMakeLists.cmake b/cpp/managementgen/qmfgen/templates/CMakeLists.cmake new file mode 100644 index 0000000000..a7268ad206 --- /dev/null +++ b/cpp/managementgen/qmfgen/templates/CMakeLists.cmake @@ -0,0 +1,39 @@ +# +# 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. +# +/*MGEN:commentPrefix=#*/ +/*MGEN:Root.Disclaimer*/ +/*MGEN:IF(CMakeLists.QpidBroker)*/ +/*MGEN:mgenDir=${mgen_dir}*/ +/*MGEN:specDir=${qpidc_SOURCE_DIR}/../specs*/ + +set(mgen_generator /*MGEN:CMakeLists.GenSources*/) + +set(mgen_broker_cpp /*MGEN:CMakeLists.GenCppFiles*/) + +# Header file install rules. +#/*MGEN:CMakeLists.HeaderInstalls*/ +#if GENERATE +#$(srcdir)/managementgen.mk: $(mgen_generator) +# $(mgen_cmd) +# +#$(mgen_generator): +#endif +#/*MGEN:ENDIF*/ + +set(qmfgen_sources /*MGEN:CMakeLists.GeneratedFiles*/) diff --git a/cpp/rubygen/generate b/cpp/rubygen/generate index 836626cd7a..0ce1fec46a 100755 --- a/cpp/rubygen/generate +++ b/cpp/rubygen/generate @@ -26,7 +26,8 @@ require 'amqpgen' if ARGV.size < 3 puts < @@ -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::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 -// 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); -- cgit v1.2.1