[mingw-qpid-cpp: 23/28] Update to 0.14 and added mingw-w64 compatibility
Kalev Lember
kalev at fedoraproject.org
Wed Mar 7 17:18:44 UTC 2012
commit bbc7d1e59d8ba10a93caf140a9c8c8b9f78a5a62
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date: Tue Feb 28 15:20:51 2012 +0100
Update to 0.14 and added mingw-w64 compatibility
- Update to 0.14
- Rebuild against the mingw-w64 toolchain
- Made the package compile against mingw-w64
- Fixed boost 1.48 compatibility (thanks to Petr Machata's patch: #761045)
- Dropped upstreamed patch
- Made the Source URL more dynamic
- Dropped the Boost_COMPILER override as that is already
defined in the mingw32-filesystem package (RHBZ #701334)
- Added -Wl,--export-all-symbols to the linker flags as was done in the RHEL6 package
- Use a more verbose filelist so missing files can be spotted earlier
- Make sure the import libraries are placed in %{_mingw32_libdir}
instead of %{_mingw32_bindir}
fedora.patch | 2030 ------------------------------------
mingw32-qpid-cpp.spec | 86 ++-
qpid-build-qmf2-on-win32.patch | 57 +
qpid-cpp-singleton.patch | 22 +
qpid-dont-build-docs.patch | 22 +
qpid-mingw-w64-compatibility.patch | 119 +++
6 files changed, 293 insertions(+), 2043 deletions(-)
---
diff --git a/mingw32-qpid-cpp.spec b/mingw32-qpid-cpp.spec
index d080f2f..c565483 100644
--- a/mingw32-qpid-cpp.spec
+++ b/mingw32-qpid-cpp.spec
@@ -6,17 +6,29 @@
%define __debug_install_post %{_mingw32_debug_install_post}
Name: mingw32-qpid-cpp
-Version: 0.12
-Release: 2.2%{?dist}
+Version: 0.14
+Release: 1%{?dist}
Summary: MinGW Windows port of AMQP C++ Daemons and Libraries
Group: Development/Libraries
License: ASL 2.0
URL: http://qpid.apache.org
-Source0: http://www.apache.org/dist/qpid/0.12/qpid-0.12.tar.gz
+# first two digits of version
+%define release_version %(echo %{version} | awk -F. '{print $1"."$2}')
+Source0: http://www.apache.org/dist/qpid/%{release_version}/qpid-%{version}.tar.gz
-Patch0: fedora.patch
+# Compatibility with boost 1.48
+Patch0: qpid-cpp-singleton.patch
+
+# Compatibility fixes for mingw-w64
+Patch1: qpid-mingw-w64-compatibility.patch
+
+# Don't automatically try to build the documenation when doxygen is available
+Patch2: qpid-dont-build-docs.patch
+
+# Make sure QMF2 support is enabled
+Patch3: qpid-build-qmf2-on-win32.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -36,7 +48,21 @@ an AMQP message broker using the AMQP protocol.
%prep
%setup -q -n qpid-%{version}
-%patch0 -p2
+%patch0 -p1 -b .singleton
+%patch1 -p1 -b .mingw-w64
+%patch2 -p1 -b .docs
+%patch3 -p2 -b .qmf2
+
+# Temporary ignore various fatal warnings so qpid-cpp can be built against mingw-w64:
+# qpid-0.14/cpp/src/qpid/sys/windows/uuid.cpp:54:29: error: cast from type 'const uint8_t* {aka const unsigned char*}' to type 'UUID* {aka _GUID*}' casts away qualifiers [-Werror=cast-qual]
+# qpid-0.14/cpp/src/qpid/sys/windows/AsynchIO.cpp:151:12: error: deleting object of polymorphic class type 'qpid::sys::windows::AsynchAcceptResult' which has non-virtual destructor might cause undefined behaviour [-Werror=delete-non-virtual-dtor]
+# qpid-0.14/cpp/src/tests/Uuid.cpp:51:167: error: narrowing conversion of ''\37777777672'' from 'char' to 'unsigned char' inside { } is ill-formed in C++11 [-Werror=narrowing]
+#
+# /usr/i686-w64-mingw32/sys-root/mingw/include/boost/smart_ptr/intrusive_ptr.hpp: In instantiation of 'boost::intrusive_ptr<T>::intrusive_ptr(const boost::intrusive_ptr<T>&) [with T = qpid::sys::TimerTask; boost::intrusive_ptr<T> = boost::intrusive_ptr<qpid::sys::TimerTask>]':
+# qpid-0.14/cpp/src/qpid/sys/Timer.cpp:107:52: required from here
+# /usr/i686-w64-mingw32/sys-root/mingw/include/boost/smart_ptr/intrusive_ptr.hpp:91:23: error: 'intrusive_ptr_add_ref' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
+sed -i s/'-Wcast-qual'/'-Wno-error=delete-non-virtual-dtor -Wno-error=narrowing -fpermissive'/ cpp/src/CMakeLists.txt
+
%build
%{__mkdir_p} build
@@ -45,11 +71,8 @@ pushd build
-DBUILD_MSCLFS:BOOL=OFF \
-DBUILD_MSSQL:BOOL=OFF \
-DBUILD_SSL:BOOL=OFF \
-%if "%{?dist}" == ".fc17"
- -DBoost_COMPILER:STRING=-gcc46 ../cpp
-%else
- -DBoost_COMPILER:STRING=-gcc45 ../cpp
-%endif
+ -DCMAKE_SHARED_LINKER_FLAGS:STRING=-Wl,--export-all-symbols \
+ ../cpp
popd
make -C build VERBOSE=1 %{?_smp_mflags}
@@ -63,6 +86,14 @@ rm -rf $RPM_BUILD_ROOT%{_mingw32_prefix}/examples
rm -rf $RPM_BUILD_ROOT%{_mingw32_prefix}/bin/qpid-latency-test.exe
rm -rf $RPM_BUILD_ROOT%{_mingw32_prefix}/bin/qpid-perftest.exe
+# Drop a man-page which is duplicate with the native qpid-cpp package
+# and which is installed to the wrong folder anyway
+rm -f $RPM_BUILD_ROOT/man1/qpidd.1 || :
+
+# Move the import libraries to the libdir
+mkdir $RPM_BUILD_ROOT%{_mingw32_libdir}
+mv $RPM_BUILD_ROOT%{_mingw32_bindir}/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
+
# Maybe install some test programs for validation
#{__install} -d $RPM_BUILD_ROOT $RPM_BUILD_ROOT{_mingw32_bindir}
@@ -73,17 +104,46 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%doc %{_mingw32_prefix}/LICENSE
%doc %{_mingw32_prefix}/NOTICE
+%doc cpp/RELEASE_NOTES
%{_mingw32_prefix}/conf
%{_mingw32_prefix}/plugins
%{_mingw32_prefix}/managementgen
%{_mingw32_includedir}/qpid
%{_mingw32_includedir}/qmf
%{_mingw32_bindir}/qpidd.exe
-%{_mingw32_bindir}/*.dll
-%{_mingw32_bindir}/lib*.dll.a
-%doc cpp/RELEASE_NOTES
+%{_mingw32_bindir}/libqmf.dll
+%{_mingw32_bindir}/libqmf2.dll
+%{_mingw32_bindir}/libqmfconsole.dll
+%{_mingw32_bindir}/libqmfengine.dll
+%{_mingw32_bindir}/libqpidbroker.dll
+%{_mingw32_bindir}/libqpidclient.dll
+%{_mingw32_bindir}/libqpidcommon.dll
+%{_mingw32_bindir}/libqpidmessaging.dll
+%{_mingw32_bindir}/libqpidtypes.dll
+%{_mingw32_libdir}/libqmf.dll.a
+%{_mingw32_libdir}/libqmf2.dll.a
+%{_mingw32_libdir}/libqmfconsole.dll.a
+%{_mingw32_libdir}/libqmfengine.dll.a
+%{_mingw32_libdir}/libqpidbroker.dll.a
+%{_mingw32_libdir}/libqpidclient.dll.a
+%{_mingw32_libdir}/libqpidcommon.dll.a
+%{_mingw32_libdir}/libqpidmessaging.dll.a
+%{_mingw32_libdir}/libqpidtypes.dll.a
%changelog
+* Sun Feb 26 2012 Erik van Pienbroek <epienbro at fedoraproject.org> - 0.14-1
+- Update to 0.14
+- Rebuild against the mingw-w64 toolchain
+- Made the package compile against mingw-w64
+- Fixed boost 1.48 compatibility (thanks to Petr Machata's patch: #761045)
+- Dropped upstreamed patch
+- Made the Source URL more dynamic
+- Dropped the Boost_COMPILER override as that is already
+ defined in the mingw32-filesystem package (RHBZ #701334)
+- Added -Wl,--export-all-symbols to the linker flags as was done in the RHEL6 package
+- Use a more verbose filelist so missing files can be spotted earlier
+- Make sure the import libraries are placed in %%{_mingw32_libdir} instead of %%{_mingw32_bindir}
+
* Mon Jan 16 2012 Ted Ross <tross at apache.org> - 0.12-2.2
- Rebuilt to resolve new dependencies
diff --git a/qpid-build-qmf2-on-win32.patch b/qpid-build-qmf2-on-win32.patch
new file mode 100644
index 0000000..fd3e0c8
--- /dev/null
+++ b/qpid-build-qmf2-on-win32.patch
@@ -0,0 +1,57 @@
+--- a/qpid/cpp/src/CMakeLists.txt
++++ b/qpid/cpp/src/CMakeLists.txt
+@@ -1081,7 +1081,7 @@ install (TARGETS qmf OPTIONAL
+ COMPONENT ${QPID_COMPONENT_QMF})
+ install_pdb (qmf ${QPID_COMPONENT_QMF})
+
+-if(NOT WIN32)
++#if(NOT WIN32)
+ set (qmf2_HEADERS
+ ../include/qmf/AgentEvent.h
+ ../include/qmf/Agent.h
+@@ -1116,7 +1116,6 @@
+ ../include/qmf/exceptions.h
+ ../include/qmf/Handle.h
+ ../include/qmf/ImportExport.h
+- ../include/qmf/posix/EventNotifier.h
+ ../include/qmf/Query.h
+ ../include/qmf/Schema.h
+ ../include/qmf/SchemaId.h
+@@ -1148,8 +1147,6 @@
+ qmf/DataImpl.h
+ qmf/EventNotifierImpl.h
+ qmf/EventNotifierImpl.cpp
+- qmf/PosixEventNotifier.cpp
+- qmf/PosixEventNotifierImpl.cpp
+ qmf/exceptions.cpp
+ qmf/Expression.cpp
+ qmf/Expression.h
+@@ -1172,6 +1169,19 @@
+ qmf/SubscriptionImpl.h
+ )
+
++if(NOT WIN32)
++ set (qmf2_HEADERS
++ ${qmf2_HEADERS}
++ ../include/qmf/posix/EventNotifier.h
++ )
++
++ set (qmf2_SOURCES
++ ${qmf2_SOURCES}
++ qmf/PosixEventNotifier.cpp
++ qmf/PosixEventNotifierImpl.cpp
++ )
++endif (NOT WIN32)
++
+ add_msvc_version (qmf2 library dll)
+ add_library (qmf2 SHARED ${qmf2_SOURCES})
+ target_link_libraries (qmf2 qpidmessaging qpidtypes qpidclient qpidcommon)
+@@ -1184,7 +1194,7 @@
+ DESTINATION ${QPID_INSTALL_INCLUDEDIR}/qmf
+ COMPONENT ${QPID_COMPONENT_QMF})
+ install_pdb (qmf2 ${QPID_COMPONENT_QMF})
+-endif (NOT WIN32)
++#endif (NOT WIN32)
+
+ set (qmfengine_SOURCES
+ qmf/engine/Agent.cpp
diff --git a/qpid-cpp-singleton.patch b/qpid-cpp-singleton.patch
new file mode 100644
index 0000000..6525732
--- /dev/null
+++ b/qpid-cpp-singleton.patch
@@ -0,0 +1,22 @@
+diff -up qpid-0.12/cpp/src/qpid/log/Logger.cpp\~ qpid-0.12/cpp/src/qpid/log/Logger.cpp
+--- qpid-0.12/cpp/src/qpid/log/Logger.cpp~ 2011-05-02 15:20:36.000000000 +0200
++++ qpid-0.12/cpp/src/qpid/log/Logger.cpp 2011-12-07 21:11:15.238671000 +0100
+@@ -23,7 +23,7 @@
+ #include "qpid/sys/Thread.h"
+ #include "qpid/sys/Time.h"
+ #include "qpid/DisableExceptionLogging.h"
+-#include <boost/pool/detail/singleton.hpp>
++#include <boost/serialization/singleton.hpp>
+ #include <boost/bind.hpp>
+ #include <boost/function.hpp>
+ #include <algorithm>
+@@ -45,7 +45,7 @@ inline void Logger::enable_unlocked(Stat
+ }
+
+ Logger& Logger::instance() {
+- return boost::details::pool::singleton_default<Logger>::instance();
++ return boost::serialization::singleton<Logger>::get_mutable_instance();
+ }
+
+ Logger::Logger() : flags(0) {
+
diff --git a/qpid-dont-build-docs.patch b/qpid-dont-build-docs.patch
new file mode 100644
index 0000000..044c53a
--- /dev/null
+++ b/qpid-dont-build-docs.patch
@@ -0,0 +1,22 @@
+Index: qpid-cpp-0.12/cpp/src/CMakeLists.txt
+===================================================================
+--- qpid-cpp-0.12.orig/cpp/src/CMakeLists.txt
++++ qpid-cpp-0.12/cpp/src/CMakeLists.txt
+@@ -239,15 +239,9 @@ if (GEN_MANPAGES AND NOT HELP2MAN)
+ endif (GEN_MANPAGES AND NOT HELP2MAN)
+
+ # FindDoxygen module tries to locate doxygen and Graphviz dot
+-set (docs_default ON)
+-if (NOT DOXYGEN_EXECUTABLE)
+- set (docs_default OFF)
+-endif (NOT DOXYGEN_EXECUTABLE)
++set (docs_default OFF)
+ option(GEN_DOXYGEN "Use doxygen to generate user documentation" ${docs_default})
+-if (GEN_DOXYGEN AND NOT DOXYGEN_EXECUTABLE)
+- message(STATUS "Can't locate the doxygen command; user documentation will not be generated")
+- set (GEN_DOXYGEN OFF)
+-endif (GEN_DOXYGEN AND NOT DOXYGEN_EXECUTABLE)
++set (GEN_DOXYGEN OFF)
+
+ find_program(VALGRIND valgrind DOC "Location of the valgrind program")
+ option(ENABLE_VALGRIND "Use valgrind to detect run-time problems" ON)
diff --git a/qpid-mingw-w64-compatibility.patch b/qpid-mingw-w64-compatibility.patch
new file mode 100644
index 0000000..4cb8d60
--- /dev/null
+++ b/qpid-mingw-w64-compatibility.patch
@@ -0,0 +1,119 @@
+--- qpid-0.14/cpp/src/qpid/sys/windows/AsynchIO.cpp.orig 2012-02-26 15:20:56.200358160 +0100
++++ qpid-0.14/cpp/src/qpid/sys/windows/AsynchIO.cpp 2012-02-26 15:22:40.262235099 +0100
+@@ -49,7 +49,7 @@
+ * The function pointers for AcceptEx and ConnectEx need to be looked up
+ * at run time.
+ */
+-const LPFN_ACCEPTEX lookUpAcceptEx(const qpid::sys::Socket& s) {
++LPFN_ACCEPTEX lookUpAcceptEx(const qpid::sys::Socket& s) {
+ SOCKET h = toSocketHandle(s);
+ GUID guidAcceptEx = WSAID_ACCEPTEX;
+ DWORD dwBytes = 0;
+--- qpid-0.14/cpp/src/qpid/sys/windows/SocketAddress.cpp.orig 2012-02-26 15:06:44.378021625 +0100
++++ qpid-0.14/cpp/src/qpid/sys/windows/SocketAddress.cpp 2012-02-26 15:08:48.261235760 +0100
+@@ -25,8 +25,9 @@
+ #include "qpid/Msg.h"
+
+ // Ensure we get all of winsock2.h
+-#ifndef _WIN32_WINNT
+-#define _WIN32_WINNT 0x0501
++#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
++#undef _WIN32_WINNT
++#define _WIN32_WINNT 0x0600
+ #endif
+
+ #include <winsock2.h>
+--- qpid-0.14/cpp/src/qpid/sys/windows/Thread.cpp.orig 2012-02-26 16:03:09.538818335 +0100
++++ qpid-0.14/cpp/src/qpid/sys/windows/Thread.cpp 2012-02-26 16:05:12.945046425 +0100
+@@ -191,7 +191,7 @@
+ &threadId);
+
+ #ifdef _DLL
+- if (h == NULL) {
++ if (h == 0) {
+ ScopedCriticalSection l(threadLock);
+ if (--runningThreads == 0)
+ SetEvent(threadsDone);
+@@ -278,7 +278,7 @@
+ // loaded and freed repeatedly . Be mindful of Windows loader lock
+ // and other DllMain restrictions.
+
+-BOOL APIENTRY DllMain(HMODULE hm, DWORD reason, LPVOID reserved) {
++BOOL APIENTRY DllMain(HMODULE /*hm*/, DWORD reason, LPVOID reserved) {
+ switch (reason) {
+ case DLL_PROCESS_ATTACH:
+ InitializeCriticalSection(&threadLock);
+--- qpid-0.14/cpp/src/qpid/broker/MessageGroupManager.cpp.orig 2012-02-26 17:49:51.740552620 +0100
++++ qpid-0.14/cpp/src/qpid/broker/MessageGroupManager.cpp 2012-02-26 17:51:16.435038922 +0100
+@@ -340,6 +340,11 @@
+ }
+ */
+
++/* On Win32 there's already a #define GROUP_NAME mentioned in one of the headers */
++#ifdef GROUP_NAME
++#undef GROUP_NAME
++#endif
++
+ namespace {
+ const std::string GROUP_NAME("name");
+ const std::string GROUP_OWNER("owner");
+--- qpid-0.14/cpp/src/windows/QpiddBroker.cpp.orig 2012-02-26 17:59:42.384926953 +0100
++++ qpid-0.14/cpp/src/windows/QpiddBroker.cpp 2012-02-26 18:02:50.901247220 +0100
+@@ -349,7 +349,7 @@
+
+ if (myOptions->service.install) {
+ // Handle start type
+- DWORD startType;
++ DWORD startType = 0;
+ if (myOptions->service.startType.compare("demand") == 0)
+ startType = SERVICE_DEMAND_START;
+ else if (myOptions->service.startType.compare("auto") == 0)
+@@ -459,7 +459,7 @@
+ // the service is stopped.
+ SERVICE_TABLE_ENTRY dispatchTable[] =
+ {
+- { "", (LPSERVICE_MAIN_FUNCTION)ServiceMain },
++ { (LPSTR)"", (LPSERVICE_MAIN_FUNCTION)ServiceMain },
+ { NULL, NULL }
+ };
+ if (!StartServiceCtrlDispatcher(dispatchTable)) {
+--- qpid-0.14/cpp/src/windows/SCM.cpp.orig 2012-02-26 18:03:29.390925460 +0100
++++ qpid-0.14/cpp/src/windows/SCM.cpp 2012-02-26 18:03:52.811338194 +0100
+@@ -23,7 +23,9 @@
+ #include "qpid/sys/windows/check.h"
+ #include "SCM.h"
+
++#ifdef _MSC_VER
+ #pragma comment(lib, "advapi32.lib")
++#endif
+
+ namespace {
+
+--- qpid-0.14/cpp/src/qpid/broker/QueueFlowLimit.h.orig 2012-02-26 19:16:57.891887982 +0100
++++ qpid-0.14/cpp/src/qpid/broker/QueueFlowLimit.h 2012-02-26 19:17:11.001121833 +0100
+@@ -85,8 +85,8 @@
+ /** the queue has removed QueuedMessage. Returns true if flow state changes */
+ QPID_BROKER_EXTERN void dequeued(const QueuedMessage&);
+ /** ignored */
+- QPID_BROKER_EXTERN void acquired(const QueuedMessage&) {};
+- QPID_BROKER_EXTERN void requeued(const QueuedMessage&) {};
++ QPID_BROKER_INLINE_EXTERN void acquired(const QueuedMessage&) {};
++ QPID_BROKER_INLINE_EXTERN void requeued(const QueuedMessage&) {};
+
+ /** for clustering: */
+ QPID_BROKER_EXTERN void getState(qpid::framing::FieldTable&) const;
+--- qpid-0.14/cpp/include/qpid/console/ClassKey.h.orig 2012-02-26 19:21:24.375641371 +0100
++++ qpid-0.14/cpp/include/qpid/console/ClassKey.h 2012-02-26 19:21:43.786987597 +0100
+@@ -39,9 +39,9 @@
+
+ QPID_CONSOLE_EXTERN ClassKey(const std::string& package, const std::string& name, const uint8_t* hash);
+
+- const QPID_CONSOLE_EXTERN std::string& getPackageName() const { return package; }
+- const QPID_CONSOLE_EXTERN std::string& getClassName() const { return name; }
+- const QPID_CONSOLE_EXTERN uint8_t* getHash() const { return hash; }
++ const QPID_CONSOLE_INLINE_EXTERN std::string& getPackageName() const { return package; }
++ const QPID_CONSOLE_INLINE_EXTERN std::string& getClassName() const { return name; }
++ const QPID_CONSOLE_INLINE_EXTERN uint8_t* getHash() const { return hash; }
+ QPID_CONSOLE_EXTERN std::string getHashString() const;
+ QPID_CONSOLE_EXTERN std::string str() const;
+ QPID_CONSOLE_EXTERN bool operator==(const ClassKey& other) const;
More information about the scm-commits
mailing list