I'd like to split out the new messaging API into its own library. This is the first part of changes to more clearly delimit the stable ABI. Applications using the new API should now link against this library rather than against qpidclient directly.

Attached is a patch for review. If you have any objections or concerns please shout.

The next step is to only export those symbols explicitly marked for external use. I have a few glitches to iron out with that.
>From 1af262dc1ce3107f5051ca9e370af150f1f9cf83 Mon Sep 17 00:00:00 2001
From: Gordon Sim <[email protected]>
Date: Tue, 11 May 2010 13:06:31 +0100
Subject: [PATCH] Add new qpidmessaging library to separate out the ABI stable interfaces

---
 qpid/cpp/examples/messaging/CMakeLists.txt      |   10 ++--
 qpid/cpp/examples/messaging/Makefile.am         |    4 +-
 qpid/cpp/examples/messaging/extra_dist/Makefile |    2 +-
 qpid/cpp/src/CMakeLists.txt                     |   47 ++++++++++++++++------
 qpid/cpp/src/Makefile.am                        |   19 ++++++---
 qpid/cpp/src/tests/CMakeLists.txt               |    8 ++--
 qpid/cpp/src/tests/Makefile.am                  |   11 +++--
 7 files changed, 65 insertions(+), 36 deletions(-)

diff --git a/qpid/cpp/examples/messaging/CMakeLists.txt b/qpid/cpp/examples/messaging/CMakeLists.txt
index c962f4d..31195f0 100644
--- a/qpid/cpp/examples/messaging/CMakeLists.txt
+++ b/qpid/cpp/examples/messaging/CMakeLists.txt
@@ -23,7 +23,7 @@
 macro(add_messaging_example example)
   add_executable(${example} ${example}.cpp OptionParser.cpp)
   set_target_properties(${example} PROPERTIES OUTPUT_NAME ${example})
-  target_link_libraries(${example} qpidclient ${_boost_libs_needed})
+  target_link_libraries(${example} qpidmessaging ${_boost_libs_needed})
   # For installs, don't install the built example; that would be pointless.
   # Install the things a user needs to build the example on-site.
   install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${example}.cpp ${CMAKE_CURRENT_SOURCE_DIR}/OptionParser.h ${CMAKE_CURRENT_SOURCE_DIR}/OptionParser.cpp
@@ -40,8 +40,8 @@ endmacro(add_messaging_example)
 add_messaging_example(drain)
 add_messaging_example(spout)
 
-add_example(messaging map_receiver)
-add_example(messaging map_sender)
+add_messaging_example(map_receiver)
+add_messaging_example(map_sender)
 
-add_example(messaging client)
-add_example(messaging server)
+add_messaging_example(client)
+add_messaging_example(server)
diff --git a/qpid/cpp/examples/messaging/Makefile.am b/qpid/cpp/examples/messaging/Makefile.am
index 1f5f2ed..298d65e 100644
--- a/qpid/cpp/examples/messaging/Makefile.am
+++ b/qpid/cpp/examples/messaging/Makefile.am
@@ -21,8 +21,8 @@ examplesdir=$(pkgdatadir)/examples/messaging
 # Settings to build the examples in automake
 AM_CXXFLAGS = $(WARNING_CFLAGS)
 INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include
-CLIENT_LIB=$(top_builddir)/src/libqpidclient.la
-CLIENTFLAGS=-lqpidclient
+CLIENT_LIB=$(top_builddir)/src/libqpidmessaging.la
+CLIENTFLAGS=-lqpidmessaging
 
 noinst_PROGRAMS=drain spout client server map_sender map_receiver hello_world hello_xml
 
diff --git a/qpid/cpp/examples/messaging/extra_dist/Makefile b/qpid/cpp/examples/messaging/extra_dist/Makefile
index 8f8be35..9b8d07e 100644
--- a/qpid/cpp/examples/messaging/extra_dist/Makefile
+++ b/qpid/cpp/examples/messaging/extra_dist/Makefile
@@ -1,6 +1,6 @@
 CXX=g++
 CXXFLAGS=-g -O2
-LDFLAGS=-lqpidclient
+LDFLAGS=-lqpidmessaging
 
 all: drain spout client server map_sender map_receiver hello_world
 
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index e40bfd3..13cae42 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -544,7 +544,7 @@ else (CMAKE_SYSTEM_NAME STREQUAL Windows)
 
     ${qpid_poller_module}
   )
-  set (qpidcommon_platform_LIBS
+  set (qpidcommon_platform_LIBS      
     ${Boost_PROGRAM_OPTIONS_LIBRARY}
     ${Boost_FILESYSTEM_LIBRARY}
     uuid
@@ -584,10 +584,6 @@ set (qpidcommon_SOURCES
      qpid/SessionId.cpp
      qpid/StringUtils.cpp
      qpid/Url.cpp
-     qpid/types/Exception.cpp
-     qpid/types/Uuid.cpp
-     qpid/types/Variant.cpp
-     qpid/amqp_0_10/Codecs.cpp
      qpid/amqp_0_10/SessionHandler.cpp
      qpid/framing/AccumulatedAck.cpp
      qpid/framing/AMQBody.cpp
@@ -638,6 +634,7 @@ if (CLOCK_GETTIME_IN_RT)
   set (qpidcommon_platform_LIBS ${qpidcommon_platform_LIBS} rt)
 endif (CLOCK_GETTIME_IN_RT)
 target_link_libraries (qpidcommon
+                       qpidtypes
                        ${qpidcommon_platform_LIBS}
                        ${qpidcommon_sasl_lib})
 set_target_properties (qpidcommon PROPERTIES
@@ -695,6 +692,21 @@ set (qpidclient_SOURCES
      qpid/client/SubscriptionManager.cpp
      qpid/client/SubscriptionManagerImpl.cpp
      qpid/client/TCPConnector.cpp
+)
+
+
+add_library (qpidclient SHARED ${qpidclient_SOURCES})
+target_link_libraries (qpidclient qpidcommon ${qpidclient_platform_LIBS})
+set_target_properties (qpidclient PROPERTIES VERSION ${qpidc_version})
+install (TARGETS qpidclient
+         DESTINATION ${QPID_INSTALL_LIBDIR}
+         COMPONENT ${QPID_COMPONENT_CLIENT})
+install (DIRECTORY ../include/qpid
+         DESTINATION ${QPID_INSTALL_INCLUDEDIR}
+         COMPONENT ${QPID_COMPONENT_CLIENT_INCLUDE}
+         PATTERN ".svn" EXCLUDE)
+
+set (qpidmessaging_SOURCES
      qpid/messaging/Address.cpp
      qpid/messaging/AddressParser.h
      qpid/messaging/AddressParser.cpp
@@ -734,16 +746,12 @@ set (qpidclient_SOURCES
      qpid/client/amqp0_10/SimpleUrlParser.cpp
 )
 
-add_library (qpidclient SHARED ${qpidclient_SOURCES})
-target_link_libraries (qpidclient qpidcommon ${qpidclient_platform_LIBS})
-set_target_properties (qpidclient PROPERTIES VERSION ${qpidc_version})
-install (TARGETS qpidclient
+add_library (qpidmessaging SHARED ${qpidmessaging_SOURCES})
+target_link_libraries (qpidmessaging qpidclient)
+set_target_properties (qpidmessaging PROPERTIES VERSION ${qpidc_version})
+install (TARGETS qpidmessaging
          DESTINATION ${QPID_INSTALL_LIBDIR}
          COMPONENT ${QPID_COMPONENT_CLIENT})
-install (DIRECTORY ../include/qpid
-         DESTINATION ${QPID_INSTALL_INCLUDEDIR}
-         COMPONENT ${QPID_COMPONENT_CLIENT_INCLUDE}
-         PATTERN ".svn" EXCLUDE)
 
 # Released source artifacts from Apache have the generated headers included in
 # the source tree, not the binary tree. So don't attempt to grab them when
@@ -778,6 +786,19 @@ if (WIN32)
     endif (EXISTS ${DTC_PLUGIN_SOURCE})
 endif (WIN32)
 
+set (qpidtypes_SOURCES
+     qpid/types/Exception.cpp
+     qpid/types/Uuid.cpp
+     qpid/types/Variant.cpp
+     qpid/amqp_0_10/Codecs.cpp
+)
+add_library (qpidtypes SHARED ${qpidtypes_SOURCES})
+set_target_properties (qpidtypes PROPERTIES
+                       VERSION ${qpidc_version})
+install (TARGETS qpidtypes
+         DESTINATION ${QPID_INSTALL_LIBDIR}
+         COMPONENT ${QPID_COMPONENT_COMMON})
+
 set (qpidbroker_SOURCES
      ${mgen_broker_cpp}
      ${qpidbroker_platform_SOURCES}
diff --git a/qpid/cpp/src/Makefile.am b/qpid/cpp/src/Makefile.am
index eaf961d..7e369e7 100644
--- a/qpid/cpp/src/Makefile.am
+++ b/qpid/cpp/src/Makefile.am
@@ -186,7 +186,7 @@ libqpidcommon_la_SOURCES += $(poller) $(systeminfo)
 posix_broker_src = \
   qpid/broker/posix/BrokerDefaults.cpp
 
-lib_LTLIBRARIES = libqpidcommon.la libqpidbroker.la libqpidclient.la
+lib_LTLIBRARIES = libqpidtypes.la libqpidcommon.la libqpidbroker.la libqpidclient.la libqpidmessaging.la
 
 # Definitions for client and daemon plugins
 PLUGINLDFLAGS=-no-undefined -module -avoid-version
@@ -312,6 +312,7 @@ EXTRA_DIST +=\
   qpid/store
 
 libqpidcommon_la_LIBADD = \
+  libqpidtypes.la \
   -lboost_program_options \
   -lboost_filesystem \
   -luuid \
@@ -427,10 +428,6 @@ libqpidcommon_la_SOURCES +=			\
   qpid/memory.h					\
   qpid/pointer_to_other.h			\
   qpid/ptr_map.h				\
-  qpid/types/Exception.cpp			\
-  qpid/types/Uuid.cpp				\
-  qpid/types/Variant.cpp			\
-  qpid/amqp_0_10/Codecs.cpp			\
   qpid/sys/AggregateOutput.cpp			\
   qpid/sys/AggregateOutput.h			\
   qpid/sys/AsynchIO.h				\
@@ -490,6 +487,12 @@ libqpidcommon_la_SOURCES += qpid/sys/cyrus/CyrusSecurityLayer.cpp
 libqpidcommon_la_LIBADD += -lsasl2
 endif
 
+libqpidtypes_la_SOURCES =			\
+  qpid/amqp_0_10/Codecs.cpp			\
+  qpid/types/Exception.cpp			\
+  qpid/types/Uuid.cpp				\
+  qpid/types/Variant.cpp
+
 libqpidbroker_la_LIBADD = libqpidcommon.la -luuid
 
 libqpidbroker_la_SOURCES = \
@@ -706,7 +709,11 @@ libqpidclient_la_SOURCES =			\
   qpid/client/SubscriptionManagerImpl.cpp	\
   qpid/client/SubscriptionManagerImpl.h		\
   qpid/client/TCPConnector.cpp			\
-  qpid/client/TCPConnector.h			\
+  qpid/client/TCPConnector.h
+
+libqpidmessaging_la_LIBADD = libqpidclient.la
+
+libqpidmessaging_la_SOURCES =			\
   qpid/messaging/Address.cpp			\
   qpid/messaging/AddressParser.h		\
   qpid/messaging/AddressParser.cpp		\
diff --git a/qpid/cpp/src/tests/CMakeLists.txt b/qpid/cpp/src/tests/CMakeLists.txt
index 6033912..c645815 100644
--- a/qpid/cpp/src/tests/CMakeLists.txt
+++ b/qpid/cpp/src/tests/CMakeLists.txt
@@ -165,7 +165,7 @@ set_source_files_properties (ReplicationTest.cpp Shlib.cpp ${xml_tests}
                              "-DQPID_MODULE_SUFFIX=\\\"${CMAKE_SHARED_MODULE_SUFFIX}\\\" -DQPID_MODULE_PREFIX=\\\"${CMAKE_SHARED_MODULE_PREFIX}\\\"")
 target_link_libraries (unit_test
                        ${qpid_test_boost_libs}
-                       qpidclient qpidbroker qmfconsole)
+                       qpidmessaging qpidbroker qmfconsole)
 remember_location(unit_test)
 
 add_library (shlibtest MODULE shlibtest.cpp)
@@ -260,16 +260,16 @@ target_link_libraries (receiver qpidclient)
 remember_location(receiver)
 
 add_executable (sender sender.cpp Statistics.cpp ${platform_test_additions})
-target_link_libraries (sender qpidclient)
+target_link_libraries (sender qpidmessaging)
 #sender_SOURCES=sender.cpp  TestOptions.h ConnectionOptions.h
 remember_location(sender)
 
 add_executable (qpid_receive qpid_receive.cpp Statistics.cpp ${platform_test_additions})
-target_link_libraries (qpid_receive qpidclient)
+target_link_libraries (qpid_receive qpidmessaging)
 remember_location(qpid_receive)
 
 add_executable (qpid_send qpid_send.cpp Statistics.cpp ${platform_test_additions})
-target_link_libraries (qpid_send qpidclient)
+target_link_libraries (qpid_send qpidmessaging)
 remember_location(qpid_send)
 
 # perftest and latencytest are generally useful so install them
diff --git a/qpid/cpp/src/tests/Makefile.am b/qpid/cpp/src/tests/Makefile.am
index 6133fc2..ff36778 100644
--- a/qpid/cpp/src/tests/Makefile.am
+++ b/qpid/cpp/src/tests/Makefile.am
@@ -26,6 +26,7 @@ abs_srcd...@abs_srcdir@
 
 extra_libs = 
 lib_client = $(abs_builddir)/../libqpidclient.la
+lib_messaging = $(abs_builddir)/../libqpidmessaging.la
 lib_common = $(abs_builddir)/../libqpidcommon.la
 lib_broker = $(abs_builddir)/../libqpidbroker.la
 lib_console = $(abs_builddir)/../libqmfconsole.la
@@ -64,7 +65,7 @@ tmodule_LTLIBRARIES=
 TESTS+=unit_test
 check_PROGRAMS+=unit_test
 unit_test_LDADD=-lboost_unit_test_framework -lboost_regex  \
-	$(lib_client) $(lib_broker) $(lib_console)
+	$(lib_messaging) $(lib_broker) $(lib_console)
 
 unit_test_SOURCES= unit_test.cpp unit_test.h \
 	MessagingSessionTests.cpp \
@@ -161,7 +162,7 @@ sender_SOURCES = \
   TestOptions.h \
   ConnectionOptions.h \
   Statistics.cpp
-sender_LDADD = $(lib_client)
+sender_LDADD = $(lib_messaging)
 
 qpidtest_PROGRAMS += qpid_receive
 qpid_receive_SOURCES = \
@@ -170,7 +171,7 @@ qpid_receive_SOURCES = \
   ConnectionOptions.h \
   Statistics.h \
   Statistics.cpp
-qpid_receive_LDADD = $(lib_client)
+qpid_receive_LDADD = $(lib_messaging)
 
 qpidtest_PROGRAMS += qpid_send
 qpid_send_SOURCES = \
@@ -179,7 +180,7 @@ qpid_send_SOURCES = \
   ConnectionOptions.h \
   Statistics.h \
   Statistics.cpp
-qpid_send_LDADD = $(lib_client)
+qpid_send_LDADD = $(lib_messaging)
 
 qpidtest_PROGRAMS+=perftest
 perftest_SOURCES=perftest.cpp test_tools.h TestOptions.h ConnectionOptions.h
@@ -297,7 +298,7 @@ qrsh_LDADD=$(lib_client)
 check_PROGRAMS+=qpid_stream
 qpid_stream_INCLUDES=$(PUBLIC_INCLUDES)
 qpid_stream_SOURCES=qpid_stream.cpp
-qpid_stream_LDADD=$(lib_client) 
+qpid_stream_LDADD=$(lib_messaging) 
 
 TESTS_ENVIRONMENT = \
     VALGRIND=$(VALGRIND) \
-- 
1.6.2.5


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to