archrelease: copy trunk to testing-x86_64
[arch-packages.git] / abiword / trunk / boost-asio.patch
blob5156983624d577e934cedafb82f6773684d615c5
1 From de5dc5fd94a5fe321791d44e88d209a4972264ba Mon Sep 17 00:00:00 2001
2 From: Hubert Figuiere <hub@figuiere.net>
3 Date: Sun, 5 Feb 2017 02:52:37 +0000
4 Subject: [PATCH] Bug 13839 - Detect boost::asio
6 Patch by Adam Majer <amajer@suse.de>
8 git-svn-id: svn+ssh://svn.abisource.com/svnroot/abiword/trunk@35397 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
9 ---
10 .../collab/backends/service/xp/AsyncWorker.h | 7 ++++++-
11 .../backends/service/xp/RealmConnection.h | 6 +++++-
12 .../collab/backends/service/xp/RealmProtocol.h | 6 +++++-
13 .../collab/backends/service/xp/tls_tunnel.h | 6 +++++-
14 .../collab/backends/tcp/xp/IOServerHandler.h | 6 +++++-
15 plugins/collab/plugin.m4 | 18 +++++++++++-------
16 6 files changed, 37 insertions(+), 12 deletions(-)
18 diff --git a/plugins/collab/backends/service/xp/AsyncWorker.h b/plugins/collab/backends/service/xp/AsyncWorker.h
19 index ab0437c29f..2e527f9254 100644
20 --- a/plugins/collab/backends/service/xp/AsyncWorker.h
21 +++ b/plugins/collab/backends/service/xp/AsyncWorker.h
22 @@ -19,7 +19,12 @@
23 #ifndef __ASYNC_WORKER__
24 #define __ASYNC_WORKER__
26 -#include <asio.hpp>
27 +#if defined(HAVE_BOOST_ASIO_HPP)
28 +# include <boost/asio.hpp>
29 +#else
30 +# include <asio.hpp>
31 +#endif
33 #include <boost/bind.hpp>
34 #include <boost/function.hpp>
35 #include <boost/noncopyable.hpp>
36 diff --git a/plugins/collab/backends/service/xp/RealmConnection.h b/plugins/collab/backends/service/xp/RealmConnection.h
37 index 7dc715548c..214b12316b 100644
38 --- a/plugins/collab/backends/service/xp/RealmConnection.h
39 +++ b/plugins/collab/backends/service/xp/RealmConnection.h
40 @@ -21,7 +21,11 @@
42 #include <boost/shared_ptr.hpp>
43 #include <boost/enable_shared_from_this.hpp>
44 -#include <asio.hpp>
45 +#if defined(HAVE_BOOST_ASIO_HPP)
46 +# include <boost/asio.hpp>
47 +#else
48 +# include <asio.hpp>
49 +#endif
50 #include <vector>
51 #include <string>
52 #include "ut_types.h"
53 diff --git a/plugins/collab/backends/service/xp/RealmProtocol.h b/plugins/collab/backends/service/xp/RealmProtocol.h
54 index 772ad891dd..03fa536dea 100644
55 --- a/plugins/collab/backends/service/xp/RealmProtocol.h
56 +++ b/plugins/collab/backends/service/xp/RealmProtocol.h
57 @@ -9,7 +9,11 @@
58 #include <stdint.h>
59 #endif
60 #include <boost/shared_ptr.hpp>
61 -#include <asio.hpp>
62 +#if defined(HAVE_BOOST_ASIO_HPP)
63 +# include <boost/asio.hpp>
64 +#else
65 +# include <asio.hpp>
66 +#endif
68 namespace realm {
70 diff --git a/plugins/collab/backends/service/xp/tls_tunnel.h b/plugins/collab/backends/service/xp/tls_tunnel.h
71 index ea07151c70..a78f7815c3 100644
72 --- a/plugins/collab/backends/service/xp/tls_tunnel.h
73 +++ b/plugins/collab/backends/service/xp/tls_tunnel.h
74 @@ -33,7 +33,11 @@
75 #include <boost/function.hpp>
76 #include <boost/lexical_cast.hpp>
77 #include <boost/enable_shared_from_this.hpp>
78 -#include <asio.hpp>
79 +#if defined(HAVE_BOOST_ASIO_HPP)
80 +# include <boost/asio.hpp>
81 +#else
82 +# include <asio.hpp>
83 +#endif
84 #include <string>
85 #include <vector>
86 #ifdef _MSC_VER
87 diff --git a/plugins/collab/backends/tcp/xp/IOServerHandler.h b/plugins/collab/backends/tcp/xp/IOServerHandler.h
88 index 7a561f4a1c..8a2b931319 100644
89 --- a/plugins/collab/backends/tcp/xp/IOServerHandler.h
90 +++ b/plugins/collab/backends/tcp/xp/IOServerHandler.h
91 @@ -23,7 +23,11 @@
93 #include <boost/bind.hpp>
94 #include <boost/function.hpp>
95 -#include <asio.hpp>
96 +#if defined(HAVE_BOOST_ASIO_HPP)
97 +# include <boost/asio.hpp>
98 +#else
99 +# include <asio.hpp>
100 +#endif
102 #include <sync/xp/Synchronizer.h>
103 #include "Session.h"
104 diff --git a/plugins/collab/plugin.m4 b/plugins/collab/plugin.m4
105 index 98028b99ff..7cfe3a1388 100644
106 --- a/plugins/collab/plugin.m4
107 +++ b/plugins/collab/plugin.m4
108 @@ -70,20 +70,22 @@ AC_ARG_ENABLE([collab-backend-tcp],
109 enable_collab_backend_tcp=$enableval
110 if test "$enable_collab_backend_tcp" != "no"; then
111 AC_LANG_PUSH(C++)
112 - AC_CHECK_HEADERS([asio.hpp], [],
113 + AC_CHECK_HEADERS([asio.hpp], [],
114 + [AC_CHECK_HEADERS([boost/asio.hpp], [AC_DEFINE([HAVE_BOOST_ASIO_HPP])],
116 AC_MSG_ERROR([collab plugin: asio is required for the collab plugin TCP backend, see http://think-async.com/])
117 - ])
118 + ])])
119 AC_LANG_POP
120 collab_deps="yes"
122 ], [
123 AC_LANG_PUSH(C++)
124 - AC_CHECK_HEADERS([asio.hpp],
125 + AC_CHECK_HEADERS([asio.hpp],
126 + [AC_CHECK_HEADERS([boost/asio.hpp], [AC_DEFINE([HAVE_BOOST_ASIO_HPP])],
128 enable_collab_backend_tcp="yes"
129 collab_deps="yes"
130 - ])
131 + ])])
132 AC_LANG_POP
134 AC_MSG_CHECKING([for collab tcp backend])
135 @@ -112,10 +114,11 @@ AC_ARG_ENABLE([collab-backend-service],
136 enable_collab_backend_service=$enableval
137 if test "$enable_collab_backend_service" != "no"; then
138 AC_LANG_PUSH(C++)
139 - AC_CHECK_HEADERS([asio.hpp], [],
140 + AC_CHECK_HEADERS([asio.hpp], [],
141 + [AC_CHECK_HEADERS([boost/asio.hpp], [AC_DEFINE([HAVE_BOOST_ASIO_HPP])],
143 AC_MSG_ERROR([collab plugin: asio is required for the the abicollab.net backend, see http://think-async.com/])
144 - ])
145 + ])])
146 AC_LANG_POP
147 PKG_CHECK_EXISTS([ $collab_service_req ], [], [
148 AC_MSG_ERROR([collab plugin: missing dependencies])
149 @@ -125,13 +128,14 @@ AC_ARG_ENABLE([collab-backend-service],
150 ], [
151 AC_LANG_PUSH(C++)
152 AC_CHECK_HEADERS([asio.hpp],
153 + [AC_CHECK_HEADERS([boost/asio.hpp], [AC_DEFINE([HAVE_BOOST_ASIO_HPP])],
155 PKG_CHECK_EXISTS([ $collab_service_req ], [
156 enable_collab_backend_service="yes"
157 collab_deps="yes"
158 ], [
159 enable_collab_backend_service="no"
160 - ])
161 + ])])
162 ], [
163 enable_collab_backend_service="no"