summaryrefslogtreecommitdiff
path: root/libre/abiword/boost-asio.patch
blob: 5156983624d577e934cedafb82f6773684d615c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
From de5dc5fd94a5fe321791d44e88d209a4972264ba Mon Sep 17 00:00:00 2001
From: Hubert Figuiere <hub@figuiere.net>
Date: Sun, 5 Feb 2017 02:52:37 +0000
Subject: [PATCH] Bug 13839 - Detect boost::asio

Patch by Adam Majer <amajer@suse.de>

git-svn-id: svn+ssh://svn.abisource.com/svnroot/abiword/trunk@35397 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
---
 .../collab/backends/service/xp/AsyncWorker.h   |  7 ++++++-
 .../backends/service/xp/RealmConnection.h      |  6 +++++-
 .../collab/backends/service/xp/RealmProtocol.h |  6 +++++-
 .../collab/backends/service/xp/tls_tunnel.h    |  6 +++++-
 .../collab/backends/tcp/xp/IOServerHandler.h   |  6 +++++-
 plugins/collab/plugin.m4                       | 18 +++++++++++-------
 6 files changed, 37 insertions(+), 12 deletions(-)

diff --git a/plugins/collab/backends/service/xp/AsyncWorker.h b/plugins/collab/backends/service/xp/AsyncWorker.h
index ab0437c29f..2e527f9254 100644
--- a/plugins/collab/backends/service/xp/AsyncWorker.h
+++ b/plugins/collab/backends/service/xp/AsyncWorker.h
@@ -19,7 +19,12 @@
 #ifndef __ASYNC_WORKER__
 #define __ASYNC_WORKER__
 
-#include <asio.hpp>
+#if defined(HAVE_BOOST_ASIO_HPP)
+# include <boost/asio.hpp>
+#else
+# include <asio.hpp>
+#endif
+
 #include <boost/bind.hpp>
 #include <boost/function.hpp>
 #include <boost/noncopyable.hpp>
diff --git a/plugins/collab/backends/service/xp/RealmConnection.h b/plugins/collab/backends/service/xp/RealmConnection.h
index 7dc715548c..214b12316b 100644
--- a/plugins/collab/backends/service/xp/RealmConnection.h
+++ b/plugins/collab/backends/service/xp/RealmConnection.h
@@ -21,7 +21,11 @@
 
 #include <boost/shared_ptr.hpp>
 #include <boost/enable_shared_from_this.hpp>
-#include <asio.hpp>
+#if defined(HAVE_BOOST_ASIO_HPP)
+# include <boost/asio.hpp>
+#else
+# include <asio.hpp>
+#endif
 #include <vector>
 #include <string>
 #include "ut_types.h"
diff --git a/plugins/collab/backends/service/xp/RealmProtocol.h b/plugins/collab/backends/service/xp/RealmProtocol.h
index 772ad891dd..03fa536dea 100644
--- a/plugins/collab/backends/service/xp/RealmProtocol.h
+++ b/plugins/collab/backends/service/xp/RealmProtocol.h
@@ -9,7 +9,11 @@
 #include <stdint.h>
 #endif
 #include <boost/shared_ptr.hpp>
-#include <asio.hpp>
+#if defined(HAVE_BOOST_ASIO_HPP)
+# include <boost/asio.hpp>
+#else
+# include <asio.hpp>
+#endif
 
 namespace realm {
 
diff --git a/plugins/collab/backends/service/xp/tls_tunnel.h b/plugins/collab/backends/service/xp/tls_tunnel.h
index ea07151c70..a78f7815c3 100644
--- a/plugins/collab/backends/service/xp/tls_tunnel.h
+++ b/plugins/collab/backends/service/xp/tls_tunnel.h
@@ -33,7 +33,11 @@
 #include <boost/function.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/enable_shared_from_this.hpp>
-#include <asio.hpp>
+#if defined(HAVE_BOOST_ASIO_HPP)
+# include <boost/asio.hpp>
+#else
+# include <asio.hpp>
+#endif
 #include <string>
 #include <vector>
 #ifdef _MSC_VER
diff --git a/plugins/collab/backends/tcp/xp/IOServerHandler.h b/plugins/collab/backends/tcp/xp/IOServerHandler.h
index 7a561f4a1c..8a2b931319 100644
--- a/plugins/collab/backends/tcp/xp/IOServerHandler.h
+++ b/plugins/collab/backends/tcp/xp/IOServerHandler.h
@@ -23,7 +23,11 @@
 
 #include <boost/bind.hpp>
 #include <boost/function.hpp>
-#include <asio.hpp>
+#if defined(HAVE_BOOST_ASIO_HPP)
+# include <boost/asio.hpp>
+#else
+# include <asio.hpp>
+#endif
 
 #include <sync/xp/Synchronizer.h>
 #include "Session.h"
diff --git a/plugins/collab/plugin.m4 b/plugins/collab/plugin.m4
index 98028b99ff..7cfe3a1388 100644
--- a/plugins/collab/plugin.m4
+++ b/plugins/collab/plugin.m4
@@ -70,20 +70,22 @@ AC_ARG_ENABLE([collab-backend-tcp],
 	enable_collab_backend_tcp=$enableval
 	if test "$enable_collab_backend_tcp" != "no"; then
 		AC_LANG_PUSH(C++)
-		AC_CHECK_HEADERS([asio.hpp], [], 
+		AC_CHECK_HEADERS([asio.hpp], [],
+			[AC_CHECK_HEADERS([boost/asio.hpp], [AC_DEFINE([HAVE_BOOST_ASIO_HPP])],
 		[
 			AC_MSG_ERROR([collab plugin: asio is required for the collab plugin TCP backend, see http://think-async.com/])
-		])
+		])])
 		AC_LANG_POP
 		collab_deps="yes"
 	fi
 ], [
 	AC_LANG_PUSH(C++)
-	AC_CHECK_HEADERS([asio.hpp], 
+	AC_CHECK_HEADERS([asio.hpp],
+		[AC_CHECK_HEADERS([boost/asio.hpp], [AC_DEFINE([HAVE_BOOST_ASIO_HPP])],
 	[
 		enable_collab_backend_tcp="yes"
 		collab_deps="yes"
-	])
+	])])
 	AC_LANG_POP
 ])
 AC_MSG_CHECKING([for collab tcp backend])
@@ -112,10 +114,11 @@ AC_ARG_ENABLE([collab-backend-service],
 	enable_collab_backend_service=$enableval
 	if test "$enable_collab_backend_service" != "no"; then
 		AC_LANG_PUSH(C++)
-		AC_CHECK_HEADERS([asio.hpp], [], 
+		AC_CHECK_HEADERS([asio.hpp], [],
+		[AC_CHECK_HEADERS([boost/asio.hpp], [AC_DEFINE([HAVE_BOOST_ASIO_HPP])],	
 		[
 			AC_MSG_ERROR([collab plugin: asio is required for the the abicollab.net backend, see http://think-async.com/])
-		])
+		])])
 		AC_LANG_POP
 		PKG_CHECK_EXISTS([ $collab_service_req ], [], [
 			AC_MSG_ERROR([collab plugin: missing dependencies])
@@ -125,13 +128,14 @@ AC_ARG_ENABLE([collab-backend-service],
 ], [
 	AC_LANG_PUSH(C++)
 	AC_CHECK_HEADERS([asio.hpp],
+		[AC_CHECK_HEADERS([boost/asio.hpp], [AC_DEFINE([HAVE_BOOST_ASIO_HPP])],
 	[
 		PKG_CHECK_EXISTS([ $collab_service_req ], [
 			enable_collab_backend_service="yes"
 			collab_deps="yes"
 		], [
 			enable_collab_backend_service="no"
-		])
+		])])
 	], [
 		enable_collab_backend_service="no"
         ])