boost-asio.patch 5.3 KB

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