rbczmq 1.6.2 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (398) hide show
  1. data/.gitignore +4 -3
  2. data/.gitmodules +6 -0
  3. data/.travis.yml +5 -1
  4. data/CHANGELOG.rdoc +15 -0
  5. data/Gemfile.lock +2 -2
  6. data/README.rdoc +5 -2
  7. data/Rakefile +8 -3
  8. data/ext/czmq/.gitignore +52 -0
  9. data/ext/czmq/.travis.yml +18 -0
  10. data/ext/czmq/AUTHORS +9 -0
  11. data/ext/czmq/COPYING +674 -0
  12. data/ext/czmq/COPYING.LESSER +178 -0
  13. data/ext/czmq/ChangeLog +0 -0
  14. data/ext/czmq/Makefile.am +22 -0
  15. data/ext/czmq/NEWS +263 -0
  16. data/ext/czmq/README +0 -0
  17. data/ext/czmq/README.md +1122 -0
  18. data/ext/czmq/README.txt +327 -0
  19. data/ext/czmq/autogen.sh +46 -0
  20. data/ext/czmq/builds/android/Android.mk +35 -0
  21. data/ext/czmq/builds/android/Application.mk +1 -0
  22. data/ext/czmq/builds/android/build.sh +59 -0
  23. data/ext/czmq/builds/android/clean.sh +26 -0
  24. data/ext/czmq/builds/mingw32/Makefile.mingw32 +38 -0
  25. data/ext/czmq/builds/mingw32/platform.h +0 -0
  26. data/ext/czmq/builds/msvc/.gitignore +18 -0
  27. data/ext/czmq/builds/msvc/README.txt +17 -0
  28. data/ext/czmq/builds/msvc/czmq.sln +69 -0
  29. data/ext/czmq/builds/msvc/czmq.vcproj +2246 -0
  30. data/ext/czmq/builds/msvc/czmq.vcxproj +329 -0
  31. data/ext/czmq/builds/msvc/czmq.vcxproj.filters +117 -0
  32. data/ext/czmq/builds/msvc/czmq11.sln +36 -0
  33. data/ext/czmq/builds/msvc/czmq_selftest.vcproj +840 -0
  34. data/ext/czmq/builds/msvc/czmq_selftest.vcxproj +189 -0
  35. data/ext/czmq/builds/msvc/czmq_selftest.vcxproj.filters +14 -0
  36. data/ext/czmq/c +520 -0
  37. data/ext/czmq/configure.ac +229 -0
  38. data/ext/czmq/doc/Makefile.am +49 -0
  39. data/ext/czmq/doc/asciidoc.conf +57 -0
  40. data/ext/czmq/doc/czmq.txt +334 -0
  41. data/ext/czmq/doc/mkman +100 -0
  42. data/ext/czmq/doc/mksite +65 -0
  43. data/ext/czmq/doc/wdput +43 -0
  44. data/ext/czmq/doc/xml2wd.pl +242 -0
  45. data/ext/czmq/doc/zbeacon.txt +173 -0
  46. data/ext/czmq/doc/zclock.txt +51 -0
  47. data/ext/czmq/doc/zconfig.txt +92 -0
  48. data/ext/czmq/doc/zctx.txt +111 -0
  49. data/ext/czmq/doc/zfile.txt +77 -0
  50. data/ext/czmq/doc/zframe.txt +222 -0
  51. data/ext/czmq/doc/zhash.txt +225 -0
  52. data/ext/czmq/doc/zlist.txt +176 -0
  53. data/ext/czmq/doc/zloop.txt +106 -0
  54. data/ext/czmq/doc/zmsg.txt +315 -0
  55. data/ext/czmq/doc/zmutex.txt +54 -0
  56. data/ext/czmq/doc/zsocket.txt +110 -0
  57. data/ext/czmq/doc/zsockopt.txt +528 -0
  58. data/ext/czmq/doc/zstr.txt +80 -0
  59. data/ext/czmq/doc/zsys.txt +44 -0
  60. data/ext/czmq/doc/zthread.txt +126 -0
  61. data/ext/czmq/doc/ztree.txt +236 -0
  62. data/ext/czmq/images/README_1.png +0 -0
  63. data/ext/czmq/images/README_2.png +0 -0
  64. data/ext/czmq/include/czmq.h +64 -0
  65. data/ext/czmq/include/czmq_prelude.h +504 -0
  66. data/ext/czmq/include/zbeacon.h +91 -0
  67. data/ext/czmq/include/zclock.h +56 -0
  68. data/ext/czmq/include/zconfig.h +117 -0
  69. data/ext/czmq/include/zctx.h +96 -0
  70. data/ext/czmq/include/zfile.h +82 -0
  71. data/ext/czmq/include/zframe.h +145 -0
  72. data/ext/czmq/include/zhash.h +127 -0
  73. data/ext/czmq/include/zlist.h +113 -0
  74. data/ext/czmq/include/zloop.h +98 -0
  75. data/ext/czmq/include/zmsg.h +165 -0
  76. data/ext/czmq/include/zmutex.h +62 -0
  77. data/ext/czmq/include/zsocket.h +104 -0
  78. data/ext/czmq/include/zsockopt.h +249 -0
  79. data/ext/czmq/include/zstr.h +69 -0
  80. data/ext/czmq/include/zsys.h +66 -0
  81. data/ext/czmq/include/zthread.h +62 -0
  82. data/ext/czmq/include/ztree.h +133 -0
  83. data/ext/czmq/mkdoc +14 -0
  84. data/ext/czmq/model/generate +2 -0
  85. data/ext/czmq/model/sockopts.xml +101 -0
  86. data/ext/czmq/notes.txt +21 -0
  87. data/ext/czmq/scripts/sockopts.gsl +325 -0
  88. data/ext/czmq/src/Makefile.am +61 -0
  89. data/ext/czmq/src/czmq_selftest.c +60 -0
  90. data/ext/czmq/src/libczmq.pc.in +11 -0
  91. data/ext/czmq/src/selftest +7 -0
  92. data/ext/czmq/src/selftest.cfg +5 -0
  93. data/ext/czmq/src/valgrind.supp +14 -0
  94. data/ext/czmq/src/vg +2 -0
  95. data/ext/czmq/src/zbeacon.c +787 -0
  96. data/ext/czmq/src/zclock.c +143 -0
  97. data/ext/czmq/src/zconfig.c +691 -0
  98. data/ext/czmq/src/zctx.c +287 -0
  99. data/ext/czmq/src/zfile.c +237 -0
  100. data/ext/czmq/src/zframe.c +551 -0
  101. data/ext/czmq/src/zhash.c +664 -0
  102. data/ext/czmq/src/zlist.c +459 -0
  103. data/ext/czmq/src/zloop.c +496 -0
  104. data/ext/czmq/src/zmsg.c +854 -0
  105. data/ext/czmq/src/zmutex.c +134 -0
  106. data/ext/czmq/src/zsocket.c +313 -0
  107. data/ext/czmq/src/zsockopt.c +1756 -0
  108. data/ext/czmq/src/zstr.c +297 -0
  109. data/ext/czmq/src/zsys.c +136 -0
  110. data/ext/czmq/src/zthread.c +269 -0
  111. data/ext/czmq/src/ztree.c +888 -0
  112. data/ext/czmq/version.sh +21 -0
  113. data/ext/rbczmq/extconf.rb +1 -18
  114. data/ext/rbczmq/poller.c +4 -1
  115. data/ext/rbczmq/socket.c +28 -5
  116. data/ext/rbczmq/socket.h +1 -0
  117. data/ext/zeromq/AUTHORS +110 -0
  118. data/ext/zeromq/CMakeLists.txt +392 -0
  119. data/ext/zeromq/COPYING +674 -0
  120. data/ext/zeromq/COPYING.LESSER +179 -0
  121. data/ext/zeromq/INSTALL +246 -0
  122. data/ext/zeromq/MAINTAINERS +56 -0
  123. data/ext/zeromq/Makefile.am +40 -0
  124. data/ext/zeromq/NEWS +333 -0
  125. data/ext/zeromq/README +39 -0
  126. data/ext/zeromq/acinclude.m4 +930 -0
  127. data/ext/zeromq/autogen.sh +45 -0
  128. data/ext/zeromq/branding.bmp +0 -0
  129. data/ext/zeromq/builds/msvc/Makefile.am +33 -0
  130. data/ext/zeromq/builds/msvc/c_local_lat/c_local_lat.vcproj +176 -0
  131. data/ext/zeromq/builds/msvc/c_local_lat/c_local_lat.vcxproj +87 -0
  132. data/ext/zeromq/builds/msvc/c_local_thr/c_local_thr.vcproj +176 -0
  133. data/ext/zeromq/builds/msvc/c_local_thr/c_local_thr.vcxproj +87 -0
  134. data/ext/zeromq/builds/msvc/c_remote_lat/c_remote_lat.vcproj +176 -0
  135. data/ext/zeromq/builds/msvc/c_remote_lat/c_remote_lat.vcxproj +87 -0
  136. data/ext/zeromq/builds/msvc/c_remote_thr/c_remote_thr.vcproj +176 -0
  137. data/ext/zeromq/builds/msvc/c_remote_thr/c_remote_thr.vcxproj +87 -0
  138. data/ext/zeromq/builds/msvc/errno.cpp +32 -0
  139. data/ext/zeromq/builds/msvc/errno.hpp +56 -0
  140. data/ext/zeromq/builds/msvc/inproc_lat/inproc_lat.vcproj +174 -0
  141. data/ext/zeromq/builds/msvc/inproc_lat/inproc_lat.vcxproj +86 -0
  142. data/ext/zeromq/builds/msvc/inproc_thr/inproc_thr.vcproj +174 -0
  143. data/ext/zeromq/builds/msvc/inproc_thr/inproc_thr.vcxproj +86 -0
  144. data/ext/zeromq/builds/msvc/libzmq/libzmq.vcproj +804 -0
  145. data/ext/zeromq/builds/msvc/libzmq/libzmq.vcxproj +252 -0
  146. data/ext/zeromq/builds/msvc/libzmq/libzmq.vcxproj.filters +431 -0
  147. data/ext/zeromq/builds/msvc/msvc.sln +89 -0
  148. data/ext/zeromq/builds/msvc/msvc10.sln +116 -0
  149. data/ext/zeromq/builds/msvc/platform.hpp +32 -0
  150. data/ext/zeromq/builds/msvc/properties/Common.props +21 -0
  151. data/ext/zeromq/builds/msvc/properties/Debug.props +19 -0
  152. data/ext/zeromq/builds/msvc/properties/Dynamic.props +20 -0
  153. data/ext/zeromq/builds/msvc/properties/Executable.props +19 -0
  154. data/ext/zeromq/builds/msvc/properties/Precompiled.props +14 -0
  155. data/ext/zeromq/builds/msvc/properties/Release.props +22 -0
  156. data/ext/zeromq/builds/msvc/properties/Win32.props +12 -0
  157. data/ext/zeromq/builds/msvc/properties/Win32_Release.props +17 -0
  158. data/ext/zeromq/builds/msvc/properties/WithOpenPGM.props +12 -0
  159. data/ext/zeromq/builds/msvc/properties/ZeroMQ.props +23 -0
  160. data/ext/zeromq/builds/msvc/properties/x64.props +12 -0
  161. data/ext/zeromq/builds/redhat/zeromq.spec.in +160 -0
  162. data/ext/zeromq/builds/valgrind/valgrind.supp +14 -0
  163. data/ext/zeromq/builds/valgrind/vg +1 -0
  164. data/ext/zeromq/cmake/Modules/TestZMQVersion.cmake +35 -0
  165. data/ext/zeromq/cmake/Modules/zmq_version.cpp +31 -0
  166. data/ext/zeromq/cmake/NSIS.template32.in +952 -0
  167. data/ext/zeromq/cmake/NSIS.template64.in +960 -0
  168. data/ext/zeromq/configure.in +428 -0
  169. data/ext/zeromq/doc/Makefile.am +51 -0
  170. data/ext/zeromq/doc/asciidoc.conf +56 -0
  171. data/ext/zeromq/doc/zmq.txt +233 -0
  172. data/ext/zeromq/doc/zmq_bind.txt +102 -0
  173. data/ext/zeromq/doc/zmq_close.txt +52 -0
  174. data/ext/zeromq/doc/zmq_connect.txt +98 -0
  175. data/ext/zeromq/doc/zmq_ctx_destroy.txt +66 -0
  176. data/ext/zeromq/doc/zmq_ctx_get.txt +67 -0
  177. data/ext/zeromq/doc/zmq_ctx_new.txt +49 -0
  178. data/ext/zeromq/doc/zmq_ctx_set.txt +75 -0
  179. data/ext/zeromq/doc/zmq_disconnect.txt +67 -0
  180. data/ext/zeromq/doc/zmq_epgm.txt +162 -0
  181. data/ext/zeromq/doc/zmq_errno.txt +50 -0
  182. data/ext/zeromq/doc/zmq_getsockopt.txt +516 -0
  183. data/ext/zeromq/doc/zmq_init.txt +52 -0
  184. data/ext/zeromq/doc/zmq_inproc.txt +85 -0
  185. data/ext/zeromq/doc/zmq_ipc.txt +85 -0
  186. data/ext/zeromq/doc/zmq_msg_close.txt +55 -0
  187. data/ext/zeromq/doc/zmq_msg_copy.txt +57 -0
  188. data/ext/zeromq/doc/zmq_msg_data.txt +48 -0
  189. data/ext/zeromq/doc/zmq_msg_get.txt +72 -0
  190. data/ext/zeromq/doc/zmq_msg_init.txt +65 -0
  191. data/ext/zeromq/doc/zmq_msg_init_data.txt +85 -0
  192. data/ext/zeromq/doc/zmq_msg_init_size.txt +58 -0
  193. data/ext/zeromq/doc/zmq_msg_more.txt +63 -0
  194. data/ext/zeromq/doc/zmq_msg_move.txt +52 -0
  195. data/ext/zeromq/doc/zmq_msg_recv.txt +125 -0
  196. data/ext/zeromq/doc/zmq_msg_send.txt +122 -0
  197. data/ext/zeromq/doc/zmq_msg_set.txt +45 -0
  198. data/ext/zeromq/doc/zmq_msg_size.txt +48 -0
  199. data/ext/zeromq/doc/zmq_pgm.txt +162 -0
  200. data/ext/zeromq/doc/zmq_poll.txt +132 -0
  201. data/ext/zeromq/doc/zmq_proxy.txt +97 -0
  202. data/ext/zeromq/doc/zmq_recv.txt +93 -0
  203. data/ext/zeromq/doc/zmq_recvmsg.txt +123 -0
  204. data/ext/zeromq/doc/zmq_send.txt +100 -0
  205. data/ext/zeromq/doc/zmq_sendmsg.txt +119 -0
  206. data/ext/zeromq/doc/zmq_setsockopt.txt +523 -0
  207. data/ext/zeromq/doc/zmq_socket.txt +369 -0
  208. data/ext/zeromq/doc/zmq_socket_monitor.txt +288 -0
  209. data/ext/zeromq/doc/zmq_strerror.txt +55 -0
  210. data/ext/zeromq/doc/zmq_tcp.txt +101 -0
  211. data/ext/zeromq/doc/zmq_term.txt +66 -0
  212. data/ext/zeromq/doc/zmq_unbind.txt +65 -0
  213. data/ext/zeromq/doc/zmq_version.txt +53 -0
  214. data/ext/zeromq/foreign/openpgm/Makefile.am +8 -0
  215. data/ext/zeromq/foreign/openpgm/libpgm-5.1.118~dfsg.tar.gz +0 -0
  216. data/ext/zeromq/include/zmq.h +402 -0
  217. data/ext/zeromq/include/zmq_utils.h +64 -0
  218. data/ext/zeromq/installer.ico +0 -0
  219. data/ext/zeromq/perf/Makefile.am +22 -0
  220. data/ext/zeromq/perf/inproc_lat.cpp +233 -0
  221. data/ext/zeromq/perf/inproc_thr.cpp +241 -0
  222. data/ext/zeromq/perf/local_lat.cpp +109 -0
  223. data/ext/zeromq/perf/local_thr.cpp +133 -0
  224. data/ext/zeromq/perf/remote_lat.cpp +122 -0
  225. data/ext/zeromq/perf/remote_thr.cpp +105 -0
  226. data/ext/zeromq/src/Makefile.am +171 -0
  227. data/ext/zeromq/src/address.cpp +78 -0
  228. data/ext/zeromq/src/address.hpp +52 -0
  229. data/ext/zeromq/src/array.hpp +155 -0
  230. data/ext/zeromq/src/atomic_counter.hpp +197 -0
  231. data/ext/zeromq/src/atomic_ptr.hpp +196 -0
  232. data/ext/zeromq/src/blob.hpp +129 -0
  233. data/ext/zeromq/src/clock.cpp +147 -0
  234. data/ext/zeromq/src/clock.hpp +60 -0
  235. data/ext/zeromq/src/command.hpp +154 -0
  236. data/ext/zeromq/src/config.hpp +89 -0
  237. data/ext/zeromq/src/ctx.cpp +352 -0
  238. data/ext/zeromq/src/ctx.hpp +173 -0
  239. data/ext/zeromq/src/dealer.cpp +133 -0
  240. data/ext/zeromq/src/dealer.hpp +92 -0
  241. data/ext/zeromq/src/decoder.cpp +166 -0
  242. data/ext/zeromq/src/decoder.hpp +248 -0
  243. data/ext/zeromq/src/devpoll.cpp +190 -0
  244. data/ext/zeromq/src/devpoll.hpp +105 -0
  245. data/ext/zeromq/src/dist.cpp +194 -0
  246. data/ext/zeromq/src/dist.hpp +105 -0
  247. data/ext/zeromq/src/encoder.cpp +102 -0
  248. data/ext/zeromq/src/encoder.hpp +200 -0
  249. data/ext/zeromq/src/epoll.cpp +178 -0
  250. data/ext/zeromq/src/epoll.hpp +101 -0
  251. data/ext/zeromq/src/err.cpp +291 -0
  252. data/ext/zeromq/src/err.hpp +155 -0
  253. data/ext/zeromq/src/fd.hpp +45 -0
  254. data/ext/zeromq/src/fq.cpp +141 -0
  255. data/ext/zeromq/src/fq.hpp +74 -0
  256. data/ext/zeromq/src/i_decoder.hpp +49 -0
  257. data/ext/zeromq/src/i_encoder.hpp +55 -0
  258. data/ext/zeromq/src/i_engine.hpp +55 -0
  259. data/ext/zeromq/src/i_msg_sink.hpp +43 -0
  260. data/ext/zeromq/src/i_msg_source.hpp +44 -0
  261. data/ext/zeromq/src/i_poll_events.hpp +47 -0
  262. data/ext/zeromq/src/io_object.cpp +108 -0
  263. data/ext/zeromq/src/io_object.hpp +81 -0
  264. data/ext/zeromq/src/io_thread.cpp +104 -0
  265. data/ext/zeromq/src/io_thread.hpp +91 -0
  266. data/ext/zeromq/src/ip.cpp +109 -0
  267. data/ext/zeromq/src/ip.hpp +41 -0
  268. data/ext/zeromq/src/ipc_address.cpp +84 -0
  269. data/ext/zeromq/src/ipc_address.hpp +67 -0
  270. data/ext/zeromq/src/ipc_connecter.cpp +265 -0
  271. data/ext/zeromq/src/ipc_connecter.hpp +128 -0
  272. data/ext/zeromq/src/ipc_listener.cpp +206 -0
  273. data/ext/zeromq/src/ipc_listener.hpp +99 -0
  274. data/ext/zeromq/src/kqueue.cpp +201 -0
  275. data/ext/zeromq/src/kqueue.hpp +107 -0
  276. data/ext/zeromq/src/lb.cpp +148 -0
  277. data/ext/zeromq/src/lb.hpp +73 -0
  278. data/ext/zeromq/src/libzmq.pc.in +10 -0
  279. data/ext/zeromq/src/likely.hpp +33 -0
  280. data/ext/zeromq/src/mailbox.cpp +87 -0
  281. data/ext/zeromq/src/mailbox.hpp +75 -0
  282. data/ext/zeromq/src/msg.cpp +299 -0
  283. data/ext/zeromq/src/msg.hpp +148 -0
  284. data/ext/zeromq/src/mtrie.cpp +428 -0
  285. data/ext/zeromq/src/mtrie.hpp +93 -0
  286. data/ext/zeromq/src/mutex.hpp +118 -0
  287. data/ext/zeromq/src/object.cpp +393 -0
  288. data/ext/zeromq/src/object.hpp +134 -0
  289. data/ext/zeromq/src/options.cpp +562 -0
  290. data/ext/zeromq/src/options.hpp +135 -0
  291. data/ext/zeromq/src/own.cpp +206 -0
  292. data/ext/zeromq/src/own.hpp +145 -0
  293. data/ext/zeromq/src/pair.cpp +136 -0
  294. data/ext/zeromq/src/pair.hpp +79 -0
  295. data/ext/zeromq/src/pgm_receiver.cpp +283 -0
  296. data/ext/zeromq/src/pgm_receiver.hpp +141 -0
  297. data/ext/zeromq/src/pgm_sender.cpp +218 -0
  298. data/ext/zeromq/src/pgm_sender.hpp +113 -0
  299. data/ext/zeromq/src/pgm_socket.cpp +706 -0
  300. data/ext/zeromq/src/pgm_socket.hpp +124 -0
  301. data/ext/zeromq/src/pipe.cpp +447 -0
  302. data/ext/zeromq/src/pipe.hpp +207 -0
  303. data/ext/zeromq/src/poll.cpp +176 -0
  304. data/ext/zeromq/src/poll.hpp +105 -0
  305. data/ext/zeromq/src/poller.hpp +82 -0
  306. data/ext/zeromq/src/poller_base.cpp +99 -0
  307. data/ext/zeromq/src/poller_base.hpp +86 -0
  308. data/ext/zeromq/src/precompiled.cpp +21 -0
  309. data/ext/zeromq/src/precompiled.hpp +47 -0
  310. data/ext/zeromq/src/proxy.cpp +150 -0
  311. data/ext/zeromq/src/proxy.hpp +32 -0
  312. data/ext/zeromq/src/pub.cpp +57 -0
  313. data/ext/zeromq/src/pub.hpp +69 -0
  314. data/ext/zeromq/src/pull.cpp +79 -0
  315. data/ext/zeromq/src/pull.hpp +81 -0
  316. data/ext/zeromq/src/push.cpp +76 -0
  317. data/ext/zeromq/src/push.hpp +80 -0
  318. data/ext/zeromq/src/random.cpp +52 -0
  319. data/ext/zeromq/src/random.hpp +37 -0
  320. data/ext/zeromq/src/reaper.cpp +117 -0
  321. data/ext/zeromq/src/reaper.hpp +80 -0
  322. data/ext/zeromq/src/rep.cpp +137 -0
  323. data/ext/zeromq/src/rep.hpp +80 -0
  324. data/ext/zeromq/src/req.cpp +185 -0
  325. data/ext/zeromq/src/req.hpp +91 -0
  326. data/ext/zeromq/src/router.cpp +364 -0
  327. data/ext/zeromq/src/router.hpp +138 -0
  328. data/ext/zeromq/src/select.cpp +216 -0
  329. data/ext/zeromq/src/select.hpp +126 -0
  330. data/ext/zeromq/src/session_base.cpp +503 -0
  331. data/ext/zeromq/src/session_base.hpp +156 -0
  332. data/ext/zeromq/src/signaler.cpp +406 -0
  333. data/ext/zeromq/src/signaler.hpp +63 -0
  334. data/ext/zeromq/src/socket_base.cpp +1236 -0
  335. data/ext/zeromq/src/socket_base.hpp +255 -0
  336. data/ext/zeromq/src/stdint.hpp +63 -0
  337. data/ext/zeromq/src/stream_engine.cpp +594 -0
  338. data/ext/zeromq/src/stream_engine.hpp +149 -0
  339. data/ext/zeromq/src/sub.cpp +93 -0
  340. data/ext/zeromq/src/sub.hpp +71 -0
  341. data/ext/zeromq/src/tcp.cpp +131 -0
  342. data/ext/zeromq/src/tcp.hpp +38 -0
  343. data/ext/zeromq/src/tcp_address.cpp +613 -0
  344. data/ext/zeromq/src/tcp_address.hpp +100 -0
  345. data/ext/zeromq/src/tcp_connecter.cpp +319 -0
  346. data/ext/zeromq/src/tcp_connecter.hpp +123 -0
  347. data/ext/zeromq/src/tcp_listener.cpp +293 -0
  348. data/ext/zeromq/src/tcp_listener.hpp +91 -0
  349. data/ext/zeromq/src/thread.cpp +107 -0
  350. data/ext/zeromq/src/thread.hpp +79 -0
  351. data/ext/zeromq/src/trie.cpp +337 -0
  352. data/ext/zeromq/src/trie.hpp +79 -0
  353. data/ext/zeromq/src/v1_decoder.cpp +162 -0
  354. data/ext/zeromq/src/v1_decoder.hpp +68 -0
  355. data/ext/zeromq/src/v1_encoder.cpp +103 -0
  356. data/ext/zeromq/src/v1_encoder.hpp +60 -0
  357. data/ext/zeromq/src/v1_protocol.hpp +43 -0
  358. data/ext/zeromq/src/version.rc.in +93 -0
  359. data/ext/zeromq/src/windows.hpp +181 -0
  360. data/ext/zeromq/src/wire.hpp +99 -0
  361. data/ext/zeromq/src/xpub.cpp +200 -0
  362. data/ext/zeromq/src/xpub.hpp +110 -0
  363. data/ext/zeromq/src/xsub.cpp +242 -0
  364. data/ext/zeromq/src/xsub.hpp +108 -0
  365. data/ext/zeromq/src/ypipe.hpp +210 -0
  366. data/ext/zeromq/src/yqueue.hpp +199 -0
  367. data/ext/zeromq/src/zmq.cpp +1058 -0
  368. data/ext/zeromq/src/zmq_utils.cpp +61 -0
  369. data/ext/zeromq/tests/Makefile.am +55 -0
  370. data/ext/zeromq/tests/test_connect_delay.cpp +260 -0
  371. data/ext/zeromq/tests/test_connect_resolve.cpp +54 -0
  372. data/ext/zeromq/tests/test_disconnect_inproc.cpp +120 -0
  373. data/ext/zeromq/tests/test_hwm.cpp +83 -0
  374. data/ext/zeromq/tests/test_invalid_rep.cpp +92 -0
  375. data/ext/zeromq/tests/test_last_endpoint.cpp +60 -0
  376. data/ext/zeromq/tests/test_monitor.cpp +289 -0
  377. data/ext/zeromq/tests/test_msg_flags.cpp +78 -0
  378. data/ext/zeromq/tests/test_pair_inproc.cpp +53 -0
  379. data/ext/zeromq/tests/test_pair_ipc.cpp +53 -0
  380. data/ext/zeromq/tests/test_pair_tcp.cpp +54 -0
  381. data/ext/zeromq/tests/test_reqrep_device.cpp +143 -0
  382. data/ext/zeromq/tests/test_reqrep_inproc.cpp +53 -0
  383. data/ext/zeromq/tests/test_reqrep_ipc.cpp +53 -0
  384. data/ext/zeromq/tests/test_reqrep_tcp.cpp +54 -0
  385. data/ext/zeromq/tests/test_router_mandatory.cpp +62 -0
  386. data/ext/zeromq/tests/test_shutdown_stress.cpp +93 -0
  387. data/ext/zeromq/tests/test_sub_forward.cpp +99 -0
  388. data/ext/zeromq/tests/test_term_endpoint.cpp +118 -0
  389. data/ext/zeromq/tests/test_timeo.cpp +119 -0
  390. data/ext/zeromq/tests/testutil.hpp +77 -0
  391. data/ext/zeromq/version.sh +21 -0
  392. data/lib/zmq/version.rb +1 -1
  393. data/rbczmq.gemspec +16 -3
  394. data/test/test_socket.rb +13 -1
  395. metadata +398 -9
  396. checksums.yaml +0 -15
  397. data/ext/czmq-1.4.1.tar.gz +0 -0
  398. data/ext/zeromq-3.2.3.tar.gz +0 -0
@@ -0,0 +1,40 @@
1
+ ACLOCAL_AMFLAGS = -I config
2
+
3
+ if BUILD_PGM
4
+ SUBDIRS = foreign/openpgm src doc perf tests
5
+ else
6
+ SUBDIRS = src doc perf tests
7
+ endif
8
+
9
+ DIST_SUBDIRS = foreign/openpgm src doc perf tests builds/msvc
10
+
11
+ EXTRA_DIST = \
12
+ autogen.sh \
13
+ version.sh \
14
+ MAINTAINERS \
15
+ foreign/openpgm/@pgm_basename@.tar.gz
16
+ MAINTAINERCLEANFILES = \
17
+ $(srcdir)/aclocal.m4 \
18
+ $(srcdir)/autom4te.cache \
19
+ $(srcdir)/configure \
20
+ `find "$(srcdir)" -type f -name Makefile.in -print`
21
+
22
+ dist-hook:
23
+ @if test -d "$(srcdir)/.git"; \
24
+ then \
25
+ echo Creating ChangeLog && \
26
+ ( cd "$(top_srcdir)" && \
27
+ echo '# Generated by Makefile. Do not edit.'; echo; \
28
+ $(top_srcdir)/config/missing --run git log --stat ) > ChangeLog.tmp \
29
+ && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
30
+ || ( rm -f ChangeLog.tmp ; \
31
+ echo Failed to generate ChangeLog >&2 ); \
32
+ else \
33
+ echo A git clone is required to generate a ChangeLog >&2; \
34
+ fi
35
+ -cp $(top_srcdir)/builds/redhat/zeromq.spec $(distdir)/zeromq.spec
36
+ -rm -rf $(distdir)/foreign/openpgm/build-staging
37
+ distclean-local:
38
+ -rm -rf $(top_srcdir)/foreign/openpgm/build-staging
39
+ maintainer-clean-local:
40
+ -rm -rf $(top_srcdir)/config
@@ -0,0 +1,333 @@
1
+ 0MQ version 3.2.3 stable, released on 2013/05/02
2
+ ================================================
3
+
4
+ Issues addressed in this release
5
+ --------------------------------
6
+
7
+ * LIBZMQ-526 Assertion failure "Invalid argument (tcp_connecter.cpp:285)"
8
+ * LIBZMQ-446 Setting the DSCP bits by default causes CAP_NET_ADMIN error
9
+ * LIBZMQ-496 Crash on heavy socket opening/closing: Device or resource busy (mutex.hpp:90)
10
+ * LIBZMQ-462 test_connect_delay fails at test_connect_delay.cpp:80
11
+ * LIBZMQ-497 Messages getting dropped
12
+ * LIBZMQ-488 signaler.cpp leaks the win32 Event Handle
13
+ * LIBZMQ-476 zmq_disconnect has no effect for inproc sockets
14
+ * LIBZMQ-475 zmq_disconnect does not sent unsubscribe messages
15
+
16
+
17
+ 0MQ version 3.2.2 stable, released on 2012/11/23
18
+ ================================================
19
+
20
+ Issues addressed in this release
21
+ --------------------------------
22
+
23
+ * LIBZMQ-384 No meta data for ZMQ_EVENT_DISCONNECTED monitor event
24
+ * LIBZMQ-414 Error in ARM/Thumb2 assembly (atomic_ptr.hpp)
25
+ * LIBZMQ-417 zmq_assert (!incomplete_in) in session_base.cpp 228
26
+ * LIBZMQ-447 socket_base_t::recv() packet loss and memory leak at high receiving rate
27
+ * LIBZMQ-448 Builds fail on older versions of GCC
28
+ * LIBZMQ-449 Builds fail on AIX
29
+ * LIBZMQ-450 lt-test_monitor: fails with assertion at test_monitor.cpp:81
30
+ * LIBZMQ-451 ZMQ_ROUTER_MANDATORY blocks forever
31
+ * LIBZMQ-452 test_connect_delay.cpp:175:12: error: 'sleep' was not declared in this scope
32
+ * LIBZMQ-456 ZMQ_XPUB_VERBOSE does not propagate in a tree of XPUB/XSUB devices
33
+ * LIBZMQ-458 lt-test_router_mandatory fails with assertion at test_router_mandatory.cpp:53
34
+ * LIBZMQ-459 Assertion failed: encoder (stream_engine.cpp:266
35
+ * LIBZMQ-464 PUB socket with HWM set leaks memory
36
+ * LIBZMQ-465 PUB/SUB results in 80-90% of CPU load
37
+ * LIBZMQ-468 ZMQ_XPUB_VERBOSE & unsubscribe
38
+ * LIBZMQ-472 Segfault in zmq_poll in REQ to ROUTER dialog
39
+
40
+
41
+ 0MQ version 3.2.1 (RC2), released on 2012/10/15
42
+ ===============================================
43
+
44
+ Issues addressed in this release
45
+ --------------------------------
46
+
47
+ * Fixed issue xxx - handle insufficient resources on accept() properly.
48
+ * Fixed issue 443 - added ZMQ_XPUB_VERBOSE setsocket option.
49
+ * Fixed issue 433 - ZeroMQ died on receiving EPIPE
50
+ * Fixed issue 423 - test_pair_tcp hangs
51
+ * Fixed issue 416 - socket_base: fix 'va_list' has not been declared error
52
+ * Fixed issue 409 - Pub-sub interoperability between 2.x and 3.x.
53
+ * Fixed issue 404 - zmq_term can not safely be re-entered with pgm transport
54
+ * Fixed issue 399 - zmq_ctx_set_monitor callback is not works properly
55
+ * Fixed issue 393 - libzmq does not build on Android (socklen_t signed comparison)
56
+ * Fixed issue 392 - Interaction with pyzmq on Android
57
+ * Fixed issue 389 - Assertion failure in mtrie.cpp:317
58
+ * Fixed issue 388 - tests/test_monitor.cpp has no newline at EOF (causes compile error)
59
+ * Fixed issue 387 - "sa_family_t sa_family;" in pgm_socket.cpp is unused variable
60
+ * Fixed issue 385 - Rework ZMQ_FAIL_UNROUTABLE socket option to actually work
61
+ * Fixed issue 382 - Current libzmq doesn't compile on Android NDK
62
+ * Fixed issue 377 - ZeroMQ will not build on Windows with OpenPGM
63
+ * Fixed issue 375 - error: unused variable 'sa_family'
64
+ * Fixed issue 373 - Unable to build libzmq/zeromq3.x on AIX7
65
+ * Fixed issue 372 - Unable to build libzmq/zeromq3.x on HPUX 11iv3
66
+ * Fixed issue 371 - Unable to build libzmq/zeromq3.x on RHEL5/SLES10
67
+ * Fixed issue 329 - wsa_error_to_errno() calls abort() on WSAEACCES
68
+ * Fixed issue 309 - Assertion failed: options.recv_identity (socket_base.cpp:864)
69
+ * Fixed issue 211 - Assertion failed: msg_->flags & ZMQ_MSG_MORE (rep.cpp:81)
70
+
71
+ API changes
72
+ -----------
73
+
74
+ * zmq_device () deprecated and replaced by zmq_proxy ().
75
+ * zmq_ctx_set_monitor () replaced by zmq_socket_monitor ().
76
+ * ZMQ_ROUTER_BEHAVIOR/ZMQ_FAIL_UNROUTABLE renamed experimentally to
77
+ ZMQ_ROUTER_MANDATORY.
78
+
79
+
80
+ 0MQ version 3.2.0 (RC1), released on 2012/06/05
81
+ ===============================================
82
+
83
+ Bug fixes
84
+ ---------
85
+
86
+ * Fixed issue 264 - Potential bug with linger, messages dropped during
87
+ socket close.
88
+
89
+ * Fixed issue 293 - libzmq doesn't follow the ZMTP/1.0 spec (did not
90
+ set reserved bits to 0).
91
+
92
+ * Fixed issue 303 - Assertion failure in pgm_sender.cpp:102.
93
+
94
+ * Fixed issue 320 - Assertion failure in connect_session.cpp:96 when
95
+ connecting epgm to an invalid endpoint.
96
+
97
+ * Fixed issue 325 - Assertion failure in xrep.cpp:93, when two sockets
98
+ connect using the same identity.
99
+
100
+ * Fixed issue 327 - Assertion failure in mtrie.cpp:246, when
101
+ unsubscribing from channel.
102
+
103
+ * Fixed issue 346 - Assertion failure in signaler.cpp:155, when using a
104
+ closed socket.
105
+
106
+ * Fixed issue 328 - unsubscribe wrongly clears multiple subscriptions.
107
+
108
+ * Fixed issue 330 - IPC listener does not remove unix domain stream file
109
+ when terminated.
110
+
111
+ * Fixed issue 334 - Memory leak in session_base.cpp:59.
112
+
113
+ * Fixed issue 369 - ROUTER cannot close/reopen while DEALER connected.
114
+
115
+ Operating systems
116
+ -----------------
117
+
118
+ * Fixed issue 301 - HPUX 11iv2 - build fails, CLOCK_MONOTONIC
119
+ undefined.
120
+
121
+ * Fixed issue 324 - OS/X - build fails, ECANTROUTE undefined.
122
+
123
+ * Fixed issue 368 - Solaris / Sun C++ - build fails, no insert method
124
+ in multimap classes.
125
+
126
+ * Fixed issue 366 - Windows - ports not freed after crash.
127
+
128
+ * Fixed issue 355 - Windows - build fails, MSVC solution file is out of
129
+ date.
130
+
131
+ * Fixed issue 331 - FreeBSD 8 and 9 - getaddrinfo fails with
132
+ EAI_BADFLAGS on AI_V4MAPPED flag.
133
+
134
+ * Fixed issue xxx - Added support for WinCE.
135
+
136
+ Performance
137
+ -----------
138
+
139
+ * Fixed issue xxx - Implemented atomic operations for ARMv7a (runs 15-20% faster).
140
+
141
+ API changes
142
+ -----------
143
+
144
+ * Fixed issue 337 - Cleaned-up context API:
145
+
146
+ zmq_ctx_new() - create new context (will deprecate zmq_init)
147
+ zmq_ctx_destroy() - destroy context (will deprecate zmq_term)
148
+ zmq_ctx_set() - set context property
149
+ zmq_ctx_get() - get context property
150
+
151
+ * Fixed issue xxx - Cleaned-up message API:
152
+
153
+ zmq_msg_send() - send a message (will deprecate zmq_sendmsg)
154
+ zmq_msg_recv() - receive a message (will deprecate zmq_recvmsg)
155
+ zmq_msg_more() - indicate whether this is final part of message
156
+ zmq_msg_get() - get message property
157
+ zmq_msg_set() - set message property
158
+
159
+ * Fixed issue xxx - Added context monitoring API:
160
+
161
+ zmq_ctx_set_monitor() - configure monitor callback.
162
+
163
+ * Fixed issue xxx - Added unbind/disconnect API:
164
+
165
+ zmq_unbind() - unbind socket.
166
+ zmq_disconnect() - disconnect socket.
167
+
168
+ * Fixed issue xxx - Added ZMQ_TCP_ACCEPT_FILTER setsockopt() for listening TCP sockets.
169
+
170
+ * Fixed issue 336 - Removed sys: transport.
171
+
172
+ * Fixed issue 333 - Added zmq_device function back to API (was removed
173
+ in 3.0).
174
+
175
+ * Fixed issue 340 - Add support for MAX_SOCKETS to new context API.
176
+
177
+
178
+ OMQ version 3.1.0 (beta), released on 2011/12/18
179
+ ================================================
180
+
181
+ General information
182
+ -------------------
183
+
184
+ Based on community consensus, the 0MQ 3.1.x release reverts a number of
185
+ features introduced in version 3.0. The major reason for these changes is
186
+ improving backward compatibility with 0MQ 2.1.x.
187
+
188
+ Development of the 0MQ 3.0.x series will be discontinued, and users are
189
+ encouraged to upgrade to 3.1.
190
+
191
+ The 0MQ 3.1.x releases use ABI version 3.
192
+
193
+ Reverted functionality
194
+ ----------------------
195
+
196
+ The following functionality present in 0MQ 3.0 has been reverted:
197
+
198
+ * Wire format changes. The 0MQ 3.1 wire format is identical to that of 0MQ
199
+ 2.1.
200
+
201
+ * LABELs and COMMANDs have been removed.
202
+
203
+ * Explicit identies are re-introduced, however they can be used only for
204
+ explicit routing, not for durable sockets.
205
+
206
+ * The ZMQ_ROUTER and ZMQ_DEALER socket types are once again aliases for
207
+ ZMQ_XREQ and ZMQ_XREP.
208
+
209
+ New functionality
210
+ -----------------
211
+
212
+ * The zmq_getmsgopt() function has been introduced.
213
+
214
+ * Experimental IPv6 support has been introduced. This is disabled by
215
+ default, see the zmq_setsockopt() documentation for enabling it.
216
+
217
+ Other changes
218
+ -------------
219
+
220
+ * The default HWM for all socket types has been set to 1000.
221
+
222
+ * Many bug fixes.
223
+
224
+ Building
225
+ --------
226
+
227
+ * The dependency on libuuid has been removed.
228
+
229
+ * Support for building on Android, and with MSVC 10 has been added.
230
+
231
+ 0MQ version 3.0.0 (alpha), released on 2011/07/12
232
+ =================================================
233
+
234
+ New functionality
235
+ -----------------
236
+
237
+ * A zmq_ctx_set_monitor() API to register a callback / event sink for changes
238
+ in socket state.
239
+
240
+ * POSIX-compliant zmq_send and zmq_recv introduced (uses raw buffer
241
+ instead of message object).
242
+
243
+ * ZMQ_MULTICAST_HOPS socket option added. Sets the appropriate field in
244
+ IP headers of PGM packets.
245
+
246
+ * Subscription forwarding. Instead of filtering on consumer, the
247
+ subscription is moved as far as possible towards the publisher and
248
+ filtering is done there.
249
+
250
+ * ZMQ_XPUB, ZMQ_XSUB introduced. Allow to create subscription-
251
+ forwarding-friendly intermediate devices.
252
+
253
+ * Add sockopt ZMQ_RCVTIMEO/ZMQ_SNDTIMEO. Allow to set timeout for
254
+ blocking send/recv calls.
255
+
256
+ * A new LABEL flag was added to the wire format. The flag distinguishes
257
+ message parts used by 0MQ (labels) from user payload message parts.
258
+
259
+ * There is a new wire format for the REQ/REP pattern. First, the empty
260
+ bottom-of-the-stack message part is not needed any more, the LABEL
261
+ flag is used instead. Secondly, peer IDs are 32-bit integers rather
262
+ than 17-byte UUIDs.
263
+
264
+ * The REQ socket now drops duplicate replies.
265
+
266
+ * Outstanding requests & replies associated with a client are dropped
267
+ when the clients dies. This is a performance optimisation.
268
+
269
+ * Introduced ZMQ_ROUTER and ZMQ_DEALER sockets. These mimic the
270
+ functionality of ZMQ_ROUTER and ZMQ_DEALER in 0MQ/2.1.x. Guarantees
271
+ backward compatibility for exsiting code.
272
+
273
+ * Removed dependency on OS socketpair buffer size. No more asserts in
274
+ mailbox.cpp because of low system limit of sockepair buffer size.
275
+
276
+ API improvements
277
+ ----------------
278
+
279
+ * Obsolete constants ZMQ_UPSTREAM and ZMQ_DOWNSTREAM removed. Use
280
+ ZMQ_PUSH and ZMQ_PULL instead.
281
+
282
+ * Timeout in zmq_poll is in milliseconds instead of microseconds. This
283
+ makes zmq_poll() compliant with POSIX poll()
284
+
285
+ * ZMQ_MCAST_LOOP removed. There's no support for multicast over
286
+ loopback any more. Use IPC or TCP isntead.
287
+
288
+ * zmq_send/zmq_recv was renamed zmq_sendmsg/zmq_recvmsg.
289
+
290
+ * ZMQ_RECOVERY_IVL and ZMQ_RECOVERY_IVL_MSEC reconciled. The new option
291
+ is named ZMQ_RECOVERY_IVL and the unit is milliseconds.
292
+
293
+ * Option types changed. Most of the numeric types are now represented
294
+ as 'int'.
295
+
296
+ * ZMQ_HWM split into ZMQ_SNDHWM and ZMQ_RCVHWM. This makes it possible
297
+ to control message flow separately for each direction.
298
+
299
+ * ZMQ_NOBLOCK renamed ZMQ_DONTWAIT. That makes it POSIX-compliant.
300
+
301
+ Less is More
302
+ ------------
303
+
304
+ * Pre-built devices and zmq_device() removed. Should be made available
305
+ as a separate project(s).
306
+
307
+ * ZMQ_SWAP removed. Writing data to disk should be done on top of 0MQ,
308
+ on inside it.
309
+
310
+ * C++ binding removed from the core. Now it's a separate project, same
311
+ as any other binding.
312
+
313
+ Bug fixes
314
+ ---------
315
+
316
+ * Many.
317
+
318
+ Building
319
+ --------
320
+
321
+ * Make pkg-config dependency conditional.
322
+
323
+ Distribution
324
+ ------------
325
+
326
+ * Removed Debian packaging, which is now available at packages.debian.org
327
+ or via apt-get.
328
+
329
+
330
+ Older versions
331
+ ==============
332
+
333
+ * See NEWS in ZeroMQ 2.1.x repository at http://github.com/zeromq/zeromq2-1.
@@ -0,0 +1,39 @@
1
+ Welcome
2
+ -------
3
+
4
+ The 0MQ lightweight messaging kernel is a library which extends the
5
+ standard socket interfaces with features traditionally provided by
6
+ specialised messaging middleware products. 0MQ sockets provide an
7
+ abstraction of asynchronous message queues, multiple messaging patterns,
8
+ message filtering (subscriptions), seamless access to multiple transport
9
+ protocols and more.
10
+
11
+
12
+ Building and installation
13
+ -------------------------
14
+
15
+ See the INSTALL file included with the distribution.
16
+
17
+
18
+ Resources
19
+ ---------
20
+
21
+ Extensive documentation is provided with the distribution. Refer to
22
+ doc/zmq.html, or "man zmq" after you have installed 0MQ on your system.
23
+
24
+ Website: http://www.zeromq.org/
25
+
26
+ Development mailing list: zeromq-dev@lists.zeromq.org
27
+ Announcements mailing list: zeromq-announce@lists.zeromq.org
28
+
29
+ Git repository: http://github.com/zeromq/libzmq
30
+
31
+ 0MQ developers can also be found on the IRC channel #zeromq, on the
32
+ Freenode network (irc.freenode.net).
33
+
34
+ Copying
35
+ -------
36
+
37
+ Free use of this software is granted under the terms of the GNU Lesser General
38
+ Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER`
39
+ included with the 0MQ distribution.
@@ -0,0 +1,930 @@
1
+ dnl ##############################################################################
2
+ dnl # LIBZMQ_CONFIG_LIBTOOL #
3
+ dnl # Configure libtool. Requires AC_CANONICAL_HOST #
4
+ dnl ##############################################################################
5
+ AC_DEFUN([LIBZMQ_CONFIG_LIBTOOL], [{
6
+ AC_REQUIRE([AC_CANONICAL_HOST])
7
+
8
+ # Libtool configuration for different targets
9
+ case "${host_os}" in
10
+ *mingw32*|*cygwin*)
11
+ # Disable static build by default
12
+ AC_DISABLE_STATIC
13
+ ;;
14
+ *)
15
+ # Everything else with static enabled
16
+ AC_ENABLE_STATIC
17
+ ;;
18
+ esac
19
+ }])
20
+
21
+ dnl ##############################################################################
22
+ dnl # LIBZMQ_CHECK_LANG_ICC([action-if-found], [action-if-not-found]) #
23
+ dnl # Check if the current language is compiled using ICC #
24
+ dnl # Adapted from http://software.intel.com/en-us/forums/showthread.php?t=67984 #
25
+ dnl ##############################################################################
26
+ AC_DEFUN([LIBZMQ_CHECK_LANG_ICC],
27
+ [AC_CACHE_CHECK([whether we are using Intel _AC_LANG compiler],
28
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler],
29
+ [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
30
+ [[#ifndef __INTEL_COMPILER
31
+ error if not ICC
32
+ #endif
33
+ ]])],
34
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="yes" ; $1],
35
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="no" ; $2])
36
+ ])])
37
+
38
+ dnl ##############################################################################
39
+ dnl # LIBZMQ_CHECK_LANG_SUN_STUDIO([action-if-found], [action-if-not-found]) #
40
+ dnl # Check if the current language is compiled using Sun Studio #
41
+ dnl ##############################################################################
42
+ AC_DEFUN([LIBZMQ_CHECK_LANG_SUN_STUDIO],
43
+ [AC_CACHE_CHECK([whether we are using Sun Studio _AC_LANG compiler],
44
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler],
45
+ [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
46
+ [[#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C)
47
+ error if not sun studio
48
+ #endif
49
+ ]])],
50
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="yes" ; $1],
51
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="no" ; $2])
52
+ ])])
53
+
54
+ dnl ##############################################################################
55
+ dnl # LIBZMQ_CHECK_LANG_CLANG([action-if-found], [action-if-not-found]) #
56
+ dnl # Check if the current language is compiled using clang #
57
+ dnl ##############################################################################
58
+ AC_DEFUN([LIBZMQ_CHECK_LANG_CLANG],
59
+ [AC_CACHE_CHECK([whether we are using clang _AC_LANG compiler],
60
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler],
61
+ [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
62
+ [[#ifndef __clang__
63
+ error if not clang
64
+ #endif
65
+ ]])],
66
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="yes" ; $1],
67
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="no" ; $2])
68
+ ])])
69
+
70
+ dnl ##############################################################################
71
+ dnl # LIBZMQ_CHECK_LANG_GCC4([action-if-found], [action-if-not-found]) #
72
+ dnl # Check if the current language is compiled using clang #
73
+ dnl ##############################################################################
74
+ AC_DEFUN([LIBZMQ_CHECK_LANG_GCC4],
75
+ [AC_CACHE_CHECK([whether we are using gcc >= 4 _AC_LANG compiler],
76
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler],
77
+ [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
78
+ [[#if (!defined __GNUC__ || __GNUC__ < 4)
79
+ error if not gcc4 or higher
80
+ #endif
81
+ ]])],
82
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="yes" ; $1],
83
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="no" ; $2])
84
+ ])])
85
+
86
+ dnl ##############################################################################
87
+ dnl # LIBZMQ_CHECK_DOC_BUILD #
88
+ dnl # Check whether to build documentation and install man-pages #
89
+ dnl ##############################################################################
90
+ AC_DEFUN([LIBZMQ_CHECK_DOC_BUILD], [{
91
+ # Allow user to disable doc build
92
+ AC_ARG_WITH([documentation], [AS_HELP_STRING([--without-documentation],
93
+ [disable documentation build even if asciidoc and xmlto are present [default=no]])])
94
+
95
+ if test "x$with_documentation" = "xno"; then
96
+ libzmq_build_doc="no"
97
+ libzmq_install_man="no"
98
+ else
99
+ # Determine whether or not documentation should be built and installed.
100
+ libzmq_build_doc="yes"
101
+ libzmq_install_man="yes"
102
+ # Check for asciidoc and xmlto and don't build the docs if these are not installed.
103
+ AC_CHECK_PROG(libzmq_have_asciidoc, asciidoc, yes, no)
104
+ AC_CHECK_PROG(libzmq_have_xmlto, xmlto, yes, no)
105
+ if test "x$libzmq_have_asciidoc" = "xno" -o "x$libzmq_have_xmlto" = "xno"; then
106
+ libzmq_build_doc="no"
107
+ # Tarballs built with 'make dist' ship with prebuilt documentation.
108
+ if ! test -f doc/zmq.7; then
109
+ libzmq_install_man="no"
110
+ AC_MSG_WARN([You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed.])
111
+ AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.])
112
+ fi
113
+ fi
114
+
115
+ # Do not install man pages if on mingw
116
+ if test "x$libzmq_on_mingw32" = "xyes"; then
117
+ libzmq_install_man="no"
118
+ fi
119
+ fi
120
+
121
+ AC_MSG_CHECKING([whether to build documentation])
122
+ AC_MSG_RESULT([$libzmq_build_doc])
123
+
124
+ AC_MSG_CHECKING([whether to install manpages])
125
+ AC_MSG_RESULT([$libzmq_install_man])
126
+
127
+ AM_CONDITIONAL(BUILD_DOC, test "x$libzmq_build_doc" = "xyes")
128
+ AM_CONDITIONAL(INSTALL_MAN, test "x$libzmq_install_man" = "xyes")
129
+ }])
130
+
131
+ dnl ##############################################################################
132
+ dnl # LIBZMQ_CHECK_LANG_COMPILER([action-if-found], [action-if-not-found]) #
133
+ dnl # Check that compiler for the current language actually works #
134
+ dnl ##############################################################################
135
+ AC_DEFUN([LIBZMQ_CHECK_LANG_COMPILER], [{
136
+ # Test that compiler for the current language actually works
137
+ AC_CACHE_CHECK([whether the _AC_LANG compiler works],
138
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works],
139
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
140
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="yes" ; $1],
141
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="no" ; $2])
142
+ ])
143
+
144
+ if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works" != "xyes"; then
145
+ AC_MSG_ERROR([Unable to find a working _AC_LANG compiler])
146
+ fi
147
+ }])
148
+
149
+ dnl ##############################################################################
150
+ dnl # LIBZMQ_CHECK_COMPILERS #
151
+ dnl # Check compiler characteristics. This is so that we can AC_REQUIRE checks #
152
+ dnl ##############################################################################
153
+ AC_DEFUN([LIBZMQ_CHECK_COMPILERS], [{
154
+ # For that the compiler works and try to come up with the type
155
+ AC_LANG_PUSH([C])
156
+ LIBZMQ_CHECK_LANG_COMPILER
157
+
158
+ LIBZMQ_CHECK_LANG_ICC
159
+ LIBZMQ_CHECK_LANG_SUN_STUDIO
160
+ LIBZMQ_CHECK_LANG_CLANG
161
+ LIBZMQ_CHECK_LANG_GCC4
162
+ AC_LANG_POP([C])
163
+
164
+ AC_LANG_PUSH(C++)
165
+ LIBZMQ_CHECK_LANG_COMPILER
166
+
167
+ LIBZMQ_CHECK_LANG_ICC
168
+ LIBZMQ_CHECK_LANG_SUN_STUDIO
169
+ LIBZMQ_CHECK_LANG_CLANG
170
+ LIBZMQ_CHECK_LANG_GCC4
171
+ AC_LANG_POP([C++])
172
+
173
+ # Set GCC and GXX variables correctly
174
+ if test "x$GCC" = "xyes"; then
175
+ if test "xyes" = "x$libzmq_cv_c_intel_compiler"; then
176
+ GCC="no"
177
+ fi
178
+ fi
179
+
180
+ if test "x$GXX" = "xyes"; then
181
+ if test "xyes" = "x$libzmq_cv_cxx_intel_compiler"; then
182
+ GXX="no"
183
+ fi
184
+ fi
185
+ }])
186
+
187
+ dnl ############################################################################
188
+ dnl # LIBZMQ_CHECK_LANG_FLAG([flag], [action-if-found], [action-if-not-found]) #
189
+ dnl # Check if the compiler supports given flag. Works for C and C++ #
190
+ dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no #
191
+ dnl ############################################################################
192
+ AC_DEFUN([LIBZMQ_CHECK_LANG_FLAG], [{
193
+
194
+ AC_REQUIRE([AC_PROG_GREP])
195
+
196
+ AC_MSG_CHECKING([whether _AC_LANG compiler supports $1])
197
+
198
+ libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag
199
+ ac_[]_AC_LANG_ABBREV[]_werror_flag="yes"
200
+
201
+ case "x[]_AC_LANG_ABBREV" in
202
+ xc)
203
+ libzmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS"
204
+ CFLAGS="$CFLAGS $1"
205
+ ;;
206
+ xcxx)
207
+ libzmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS"
208
+ CPPFLAGS="$CPPFLAGS $1"
209
+ ;;
210
+ *)
211
+ AC_MSG_WARN([testing compiler characteristic on an unknown language])
212
+ ;;
213
+ esac
214
+
215
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
216
+ # This hack exist for ICC, which outputs unknown options as remarks
217
+ # Remarks are not turned into errors even with -Werror on
218
+ [if ($GREP 'ignoring unknown' conftest.err ||
219
+ $GREP 'not supported' conftest.err) >/dev/null 2>&1; then
220
+ eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no"
221
+ else
222
+ eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="yes"
223
+ fi],
224
+ [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no"])
225
+
226
+ case "x[]_AC_LANG_ABBREV" in
227
+ xc)
228
+ CFLAGS="$libzmq_cv_check_lang_flag_save_CFLAGS"
229
+ ;;
230
+ xcxx)
231
+ CPPFLAGS="$libzmq_cv_check_lang_flag_save_CPPFLAGS"
232
+ ;;
233
+ *)
234
+ # nothing to restore
235
+ ;;
236
+ esac
237
+
238
+ # Restore the werror flag
239
+ ac_[]_AC_LANG_ABBREV[]_werror_flag=$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save
240
+
241
+ # Call the action as the flags are restored
242
+ AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"],
243
+ [AC_MSG_RESULT(yes) ; $2], [AC_MSG_RESULT(no) ; $3])
244
+
245
+ }])
246
+
247
+ dnl ####################################################################################
248
+ dnl # LIBZMQ_CHECK_LANG_FLAG_PREPEND([flag], [action-if-found], [action-if-not-found]) #
249
+ dnl # Check if the compiler supports given flag. Works for C and C++ #
250
+ dnl # This macro prepends the flag to CFLAGS or CPPFLAGS accordingly #
251
+ dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no #
252
+ dnl ####################################################################################
253
+ AC_DEFUN([LIBZMQ_CHECK_LANG_FLAG_PREPEND], [{
254
+ LIBZMQ_CHECK_LANG_FLAG([$1])
255
+ case "x[]_AC_LANG_ABBREV" in
256
+ xc)
257
+ AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"],
258
+ [CFLAGS="$1 $CFLAGS"; $2], $3)
259
+ ;;
260
+ xcxx)
261
+ AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"],
262
+ [CPPFLAGS="$1 $CPPFLAGS"; $2], $3)
263
+ ;;
264
+ esac
265
+ }])
266
+
267
+ dnl ##############################################################################
268
+ dnl # LIBZMQ_CHECK_ENABLE_DEBUG([action-if-found], [action-if-not-found]) #
269
+ dnl # Check whether to enable debug build and set compiler flags accordingly #
270
+ dnl ##############################################################################
271
+ AC_DEFUN([LIBZMQ_CHECK_ENABLE_DEBUG], [{
272
+
273
+ # Require compiler specifics
274
+ AC_REQUIRE([LIBZMQ_CHECK_COMPILERS])
275
+
276
+ # This flag is checked also in
277
+ AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
278
+ [Enable debugging information [default=no]])])
279
+
280
+ AC_MSG_CHECKING(whether to enable debugging information)
281
+
282
+ if test "x$enable_debug" = "xyes"; then
283
+
284
+ # GCC, clang and ICC
285
+ if test "x$GCC" = "xyes" -o \
286
+ "x$libzmq_cv_c_intel_compiler" = "xyes" -o \
287
+ "x$libzmq_cv_c_clang_compiler" = "xyes"; then
288
+ CFLAGS="-g -O0 "
289
+ elif test "x$libzmq_cv_c_sun_studio_compiler" = "xyes"; then
290
+ CFLAGS="-g0 "
291
+ fi
292
+
293
+ # GCC, clang and ICC
294
+ if test "x$GXX" = "xyes" -o \
295
+ "x$libzmq_cv_cxx_intel_compiler" = "xyes" -o \
296
+ "x$libzmq_cv_cxx_clang_compiler" = "xyes"; then
297
+ CPPFLAGS="-g -O0 "
298
+ CXXFLAGS="-g -O0 "
299
+ # Sun studio
300
+ elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then
301
+ CPPFLAGS="-g0 "
302
+ CXXFLAGS="-g0 "
303
+ fi
304
+
305
+ if test "x$ZMQ_ORIG_CFLAGS" != "xnone"; then
306
+ CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}"
307
+ fi
308
+ if test "x$ZMQ_ORIG_CPPFLAGS" != "xnone"; then
309
+ CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}"
310
+ fi
311
+ if test "x$ZMQ_ORIG_CXXFLAGS" != "xnone"; then
312
+ CXXFLAGS="${CXXFLAGS} ${ZMQ_ORIG_CXXFLAGS}"
313
+ fi
314
+ AC_MSG_RESULT(yes)
315
+ else
316
+ AC_MSG_RESULT(no)
317
+ fi
318
+ }])
319
+
320
+ dnl ##############################################################################
321
+ dnl # LIBZMQ_WITH_GCOV([action-if-found], [action-if-not-found]) #
322
+ dnl # Check whether to build with code coverage #
323
+ dnl ##############################################################################
324
+ AC_DEFUN([LIBZMQ_WITH_GCOV], [{
325
+ # Require compiler specifics
326
+ AC_REQUIRE([LIBZMQ_CHECK_COMPILERS])
327
+
328
+ AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
329
+ [With GCC Code Coverage reporting.])],
330
+ [ZMQ_GCOV="$withval"])
331
+
332
+ AC_MSG_CHECKING(whether to enable code coverage)
333
+
334
+ if test "x$ZMQ_GCOV" = "xyes"; then
335
+
336
+ if test "x$GXX" != "xyes"; then
337
+ AC_MSG_ERROR([--with-gcov=yes works only with GCC])
338
+ fi
339
+
340
+ CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
341
+ if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then
342
+ CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}"
343
+ fi
344
+
345
+ CPPFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
346
+ if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then
347
+ CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}"
348
+ fi
349
+
350
+ CXXFLAGS="-fprofile-arcs"
351
+ if test "x${ZMQ_ORIG_CXXFLAGS}" != "xnone"; then
352
+ CXXFLAGS="${CXXFLAGS} ${ZMQ_ORIG_CXXFLAGS}"
353
+ fi
354
+
355
+ LIBS="-lgcov ${LIBS}"
356
+ fi
357
+
358
+ AS_IF([test "x$ZMQ_GCOV" = "xyes"],
359
+ [AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2])
360
+ }])
361
+
362
+ dnl ##############################################################################
363
+ dnl # LIBZMQ_CHECK_WITH_FLAG([flags], [macro]) #
364
+ dnl # Runs a normal autoconf check with compiler flags #
365
+ dnl ##############################################################################
366
+ AC_DEFUN([LIBZMQ_CHECK_WITH_FLAG], [{
367
+ libzmq_check_with_flag_save_CFLAGS="$CFLAGS"
368
+ libzmq_check_with_flag_save_CPPFLAGS="$CPPFLAGS"
369
+
370
+ CFLAGS="$CFLAGS $1"
371
+ CPPFLAGS="$CPPFLAGS $1"
372
+
373
+ # Execute the macro
374
+ $2
375
+
376
+ CFLAGS="$libzmq_check_with_flag_save_CFLAGS"
377
+ CPPFLAGS="$libzmq_check_with_flag_save_CPPFLAGS"
378
+ }])
379
+
380
+ dnl ##############################################################################
381
+ dnl # LIBZMQ_LANG_WALL([action-if-found], [action-if-not-found]) #
382
+ dnl # How to define -Wall for the current compiler #
383
+ dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]__wall_flag variable to found style #
384
+ dnl ##############################################################################
385
+ AC_DEFUN([LIBZMQ_LANG_WALL], [{
386
+
387
+ AC_MSG_CHECKING([how to enable additional warnings for _AC_LANG compiler])
388
+
389
+ libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag=""
390
+
391
+ # C compilers
392
+ case "x[]_AC_LANG_ABBREV" in
393
+ xc)
394
+ # GCC, clang and ICC
395
+ if test "x$GCC" = "xyes" -o \
396
+ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \
397
+ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then
398
+ libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall"
399
+ # Sun studio
400
+ elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
401
+ libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-v"
402
+ fi
403
+ ;;
404
+ xcxx)
405
+ # GCC, clang and ICC
406
+ if test "x$GXX" = "xyes" -o \
407
+ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \
408
+ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then
409
+ libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall"
410
+ # Sun studio
411
+ elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
412
+ libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="+w"
413
+ fi
414
+ ;;
415
+ *)
416
+ ;;
417
+ esac
418
+
419
+ # Call the action
420
+ if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" != "x"; then
421
+ AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag])
422
+ $1
423
+ else
424
+ AC_MSG_RESULT([not found])
425
+ $2
426
+ fi
427
+ }])
428
+
429
+ dnl ####################################################################
430
+ dnl # LIBZMQ_LANG_STRICT([action-if-found], [action-if-not-found]) #
431
+ dnl # Check how to turn on strict standards compliance #
432
+ dnl ####################################################################
433
+ AC_DEFUN([LIBZMQ_LANG_STRICT], [{
434
+ AC_MSG_CHECKING([how to enable strict standards compliance in _AC_LANG compiler])
435
+
436
+ libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag=""
437
+
438
+ # C compilers
439
+ case "x[]_AC_LANG_ABBREV" in
440
+ xc)
441
+ # GCC, clang and ICC
442
+ if test "x$GCC" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then
443
+ libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic"
444
+ elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
445
+ libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi"
446
+ # Sun studio
447
+ elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
448
+ libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-Xc"
449
+ fi
450
+ ;;
451
+ xcxx)
452
+ # GCC, clang and ICC
453
+ if test "x$GXX" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then
454
+ libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic"
455
+ elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
456
+ libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi"
457
+ # Sun studio
458
+ elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
459
+ libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-compat=5"
460
+ fi
461
+ ;;
462
+ *)
463
+ ;;
464
+ esac
465
+
466
+ # Call the action
467
+ if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag" != "x"; then
468
+ AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag])
469
+ $1
470
+ else
471
+ AC_MSG_RESULT([not found])
472
+ $2
473
+ fi
474
+ }])
475
+
476
+ dnl ########################################################################
477
+ dnl # LIBZMQ_LANG_WERROR([action-if-found], [action-if-not-found]) #
478
+ dnl # Check how to turn warnings to errors #
479
+ dnl ########################################################################
480
+ AC_DEFUN([LIBZMQ_LANG_WERROR], [{
481
+ AC_MSG_CHECKING([how to turn warnings to errors in _AC_LANG compiler])
482
+
483
+ libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag=""
484
+
485
+ # C compilers
486
+ case "x[]_AC_LANG_ABBREV" in
487
+ xc)
488
+ # GCC, clang and ICC
489
+ if test "x$GCC" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
490
+ libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror"
491
+ # Sun studio
492
+ elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
493
+ libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all"
494
+ fi
495
+ ;;
496
+ xcxx)
497
+ # GCC, clang and ICC
498
+ if test "x$GXX" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then
499
+ libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror"
500
+ # Sun studio
501
+ elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
502
+ libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all"
503
+ fi
504
+ ;;
505
+ *)
506
+ ;;
507
+ esac
508
+
509
+ # Call the action
510
+ if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag" != "x"; then
511
+ AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag])
512
+ $1
513
+ else
514
+ AC_MSG_RESULT([not found])
515
+ $2
516
+ fi
517
+ }])
518
+
519
+ dnl ################################################################################
520
+ dnl # LIBZMQ_CHECK_LANG_PRAGMA([pragma], [action-if-found], [action-if-not-found]) #
521
+ dnl # Check if the compiler supports given pragma #
522
+ dnl ################################################################################
523
+ AC_DEFUN([LIBZMQ_CHECK_LANG_PRAGMA], [{
524
+ # Need to know how to enable all warnings
525
+ LIBZMQ_LANG_WALL
526
+
527
+ AC_MSG_CHECKING([whether _AC_LANG compiler supports pragma $1])
528
+
529
+ # Save flags
530
+ libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag
531
+ ac_[]_AC_LANG_ABBREV[]_werror_flag="yes"
532
+
533
+ if test "x[]_AC_LANG_ABBREV" = "xc"; then
534
+ libzmq_cv_check_lang_pragma_save_CFLAGS="$CFLAGS"
535
+ CFLAGS="$CFLAGS $libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag"
536
+ elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then
537
+ libzmq_cv_check_lang_pragma_save_CPPFLAGS="$CPPFLAGS"
538
+ CPPFLAGS="$CPPFLAGS $libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag"
539
+ else
540
+ AC_MSG_WARN([testing compiler characteristic on an unknown language])
541
+ fi
542
+
543
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#pragma $1]])],
544
+ [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="yes" ; AC_MSG_RESULT(yes)],
545
+ [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="no" ; AC_MSG_RESULT(no)])
546
+
547
+ if test "x[]_AC_LANG_ABBREV" = "xc"; then
548
+ CFLAGS="$libzmq_cv_check_lang_pragma_save_CFLAGS"
549
+ elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then
550
+ CPPFLAGS="$libzmq_cv_check_lang_pragma_save_CPPFLAGS"
551
+ fi
552
+
553
+ ac_[]_AC_LANG_ABBREV[]_werror_flag=$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save
554
+
555
+ # Call the action as the flags are restored
556
+ AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)[ = "xyes"],
557
+ [$2], [$3])
558
+ }])
559
+
560
+ dnl ################################################################################
561
+ dnl # LIBZMQ_CHECK_LANG_VISIBILITY([action-if-found], [action-if-not-found]) #
562
+ dnl # Check if the compiler supports dso visibility #
563
+ dnl ################################################################################
564
+ AC_DEFUN([LIBZMQ_CHECK_LANG_VISIBILITY], [{
565
+
566
+ libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag=""
567
+
568
+ if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \
569
+ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes" -o \
570
+ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler" = "xyes"; then
571
+ LIBZMQ_CHECK_LANG_FLAG([-fvisibility=hidden],
572
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-fvisibility=hidden"])
573
+ elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then
574
+ LIBZMQ_CHECK_LANG_FLAG([-xldscope=hidden],
575
+ [libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-xldscope=hidden"])
576
+ fi
577
+
578
+ AC_MSG_CHECKING(whether _AC_LANG compiler supports dso visibility)
579
+
580
+ AS_IF([test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag" != "x"],
581
+ [AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2])
582
+ }])
583
+
584
+ dnl ################################################################################
585
+ dnl # LIBZMQ_CHECK_SOCK_CLOEXEC([action-if-found], [action-if-not-found]) #
586
+ dnl # Check if SOCK_CLOEXEC is supported #
587
+ dnl ################################################################################
588
+ AC_DEFUN([LIBZMQ_CHECK_SOCK_CLOEXEC], [{
589
+ AC_MSG_CHECKING(whether SOCK_CLOEXEC is supported)
590
+ AC_TRY_RUN([/* SOCK_CLOEXEC test */
591
+ #include <sys/types.h>
592
+ #include <sys/socket.h>
593
+
594
+ int main (int argc, char *argv [])
595
+ {
596
+ int s = socket (PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
597
+ return (s == -1);
598
+ }
599
+ ],
600
+ [AC_MSG_RESULT(yes) ; libzmq_cv_sock_cloexec="yes" ; $1],
601
+ [AC_MSG_RESULT(no) ; libzmq_cv_sock_cloexec="no" ; $2],
602
+ [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_sock_cloexec="no"]
603
+ )
604
+ }])
605
+
606
+ dnl ################################################################################
607
+ dnl # LIBZMQ_CHECK_SO_KEEPALIVE([action-if-found], [action-if-not-found]) #
608
+ dnl # Check if SO_KEEPALIVE is supported #
609
+ dnl ################################################################################
610
+ AC_DEFUN([LIBZMQ_CHECK_SO_KEEPALIVE], [{
611
+ AC_MSG_CHECKING(whether SO_KEEPALIVE is supported)
612
+ AC_TRY_RUN([/* SO_KEEPALIVE test */
613
+ #include <sys/types.h>
614
+ #include <sys/socket.h>
615
+
616
+ int main (int argc, char *argv [])
617
+ {
618
+ int s, rc, opt = 1;
619
+ return (
620
+ ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) ||
621
+ ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
622
+ );
623
+ }
624
+ ],
625
+ [AC_MSG_RESULT(yes) ; libzmq_cv_so_keepalive="yes" ; $1],
626
+ [AC_MSG_RESULT(no) ; libzmq_cv_so_keepalive="no" ; $2],
627
+ [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_so_keepalive="no"]
628
+ )
629
+ }])
630
+
631
+ dnl ################################################################################
632
+ dnl # LIBZMQ_CHECK_TCP_KEEPCNT([action-if-found], [action-if-not-found]) #
633
+ dnl # Check if TCP_KEEPCNT is supported #
634
+ dnl ################################################################################
635
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPCNT], [{
636
+ AC_MSG_CHECKING(whether TCP_KEEPCNT is supported)
637
+ AC_TRY_RUN([/* TCP_KEEPCNT test */
638
+ #include <sys/types.h>
639
+ #include <sys/socket.h>
640
+ #include <netinet/in.h>
641
+ #include <netinet/tcp.h>
642
+
643
+ int main (int argc, char *argv [])
644
+ {
645
+ int s, rc, opt = 1;
646
+ return (
647
+ ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) ||
648
+ ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) ||
649
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPCNT, (char*) &opt, sizeof (int))) == -1)
650
+ );
651
+ }
652
+ ],
653
+ [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepcnt="yes" ; $1],
654
+ [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepcnt="no" ; $2],
655
+ [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepcnt="no"]
656
+ )
657
+ }])
658
+
659
+ dnl ################################################################################
660
+ dnl # LIBZMQ_CHECK_TCP_KEEPIDLE([action-if-found], [action-if-not-found]) #
661
+ dnl # Check if TCP_KEEPIDLE is supported #
662
+ dnl ################################################################################
663
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPIDLE], [{
664
+ AC_MSG_CHECKING(whether TCP_KEEPIDLE is supported)
665
+ AC_TRY_RUN([/* TCP_KEEPIDLE test */
666
+ #include <sys/types.h>
667
+ #include <sys/socket.h>
668
+ #include <netinet/in.h>
669
+ #include <netinet/tcp.h>
670
+
671
+ int main (int argc, char *argv [])
672
+ {
673
+ int s, rc, opt = 1;
674
+ return (
675
+ ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) ||
676
+ ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) ||
677
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &opt, sizeof (int))) == -1)
678
+ );
679
+ }
680
+ ],
681
+ [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepidle="yes" ; $1],
682
+ [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepidle="no" ; $2],
683
+ [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepidle="no"]
684
+ )
685
+ }])
686
+
687
+ dnl ################################################################################
688
+ dnl # LIBZMQ_CHECK_TCP_KEEPINTVL([action-if-found], [action-if-not-found]) #
689
+ dnl # Check if TCP_KEEPINTVL is supported #
690
+ dnl ################################################################################
691
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPINTVL], [{
692
+ AC_MSG_CHECKING(whether TCP_KEEPINTVL is supported)
693
+ AC_TRY_RUN([/* TCP_KEEPINTVL test */
694
+ #include <sys/types.h>
695
+ #include <sys/socket.h>
696
+ #include <netinet/in.h>
697
+ #include <netinet/tcp.h>
698
+
699
+ int main (int argc, char *argv [])
700
+ {
701
+ int s, rc, opt = 1;
702
+ return (
703
+ ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) ||
704
+ ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) ||
705
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &opt, sizeof (int))) == -1)
706
+ );
707
+ }
708
+ ],
709
+ [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepintvl="yes" ; $1],
710
+ [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepintvl="no" ; $2],
711
+ [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepintvl="no"]
712
+ )
713
+ }])
714
+
715
+ dnl ################################################################################
716
+ dnl # LIBZMQ_CHECK_TCP_KEEPALIVE([action-if-found], [action-if-not-found]) #
717
+ dnl # Check if TCP_KEEPALIVE is supported #
718
+ dnl ################################################################################
719
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPALIVE], [{
720
+ AC_MSG_CHECKING(whether TCP_KEEPALIVE is supported)
721
+ AC_TRY_RUN([/* TCP_KEEPALIVE test */
722
+ #include <sys/types.h>
723
+ #include <sys/socket.h>
724
+ #include <netinet/in.h>
725
+ #include <netinet/tcp.h>
726
+
727
+ int main (int argc, char *argv [])
728
+ {
729
+ int s, rc, opt = 1;
730
+ return (
731
+ ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) ||
732
+ ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) ||
733
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
734
+ );
735
+ }
736
+ ],
737
+ [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepalive="yes" ; $1],
738
+ [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepalive="no" ; $2],
739
+ [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepalive="no"]
740
+ )
741
+ }])
742
+
743
+ dnl ################################################################################
744
+ dnl # LIBZMQ_CHECK_POLLER_KQUEUE([action-if-found], [action-if-not-found]) #
745
+ dnl # Checks kqueue polling system #
746
+ dnl ################################################################################
747
+ AC_DEFUN([LIBZMQ_CHECK_POLLER_KQUEUE], [{
748
+ AC_LINK_IFELSE(
749
+ [AC_LANG_PROGRAM(
750
+ [
751
+ #include <sys/types.h>
752
+ #include <sys/event.h>
753
+ #include <sys/time.h>
754
+ ],
755
+ [[
756
+ struct kevent t_kev;
757
+ kqueue();
758
+ ]]
759
+ )],
760
+ [libzmq_cv_have_poller_kqueue="yes" ; $1],
761
+ [libzmq_cv_have_poller_kqueue="no" ; $2])
762
+ }])
763
+
764
+ dnl ################################################################################
765
+ dnl # LIBZMQ_CHECK_POLLER_EPOLL_RUN([action-if-found], [action-if-not-found]) #
766
+ dnl # Checks epoll polling system can actually run #
767
+ dnl # For cross-compile, only requires that epoll can link #
768
+ dnl ################################################################################
769
+ AC_DEFUN([LIBZMQ_CHECK_POLLER_EPOLL], [{
770
+ AC_RUN_IFELSE(
771
+ [AC_LANG_PROGRAM(
772
+ [
773
+ #include <sys/epoll.h>
774
+ ],
775
+ [[
776
+ struct epoll_event t_ev;
777
+ int r;
778
+ r = epoll_create(10);
779
+ return(r < 0);
780
+ ]]
781
+ )],
782
+ [libzmq_cv_have_poller_epoll="yes" ; $1],
783
+ [libzmq_cv_have_poller_epoll="no" ; $2],
784
+ [
785
+ AC_LINK_IFELSE(
786
+ [AC_LANG_PROGRAM(
787
+ [
788
+ #include <sys/epoll.h>
789
+ ],
790
+ [[
791
+ struct epoll_event t_ev;
792
+ epoll_create(10);
793
+ ]]
794
+ )],
795
+ [libzmq_cv_have_poller_epoll="yes" ; $1],
796
+ [libzmq_cv_have_poller_epoll="no" ; $2])
797
+
798
+ ])
799
+ }])
800
+
801
+ dnl ################################################################################
802
+ dnl # LIBZMQ_CHECK_POLLER_DEVPOLL([action-if-found], [action-if-not-found]) #
803
+ dnl # Checks devpoll polling system #
804
+ dnl ################################################################################
805
+ AC_DEFUN([LIBZMQ_CHECK_POLLER_DEVPOLL], [{
806
+ AC_LINK_IFELSE(
807
+ [AC_LANG_PROGRAM(
808
+ [
809
+ #include <sys/devpoll.h>
810
+ ],
811
+ [[
812
+ struct pollfd t_devpoll;
813
+ int fd = open("/dev/poll", O_RDWR);
814
+ ]]
815
+ )],
816
+ [libzmq_cv_have_poller_devpoll="yes" ; $1],
817
+ [libzmq_cv_have_poller_devpoll="no" ; $2])
818
+ }])
819
+
820
+ dnl ################################################################################
821
+ dnl # LIBZMQ_CHECK_POLLER_POLL([action-if-found], [action-if-not-found]) #
822
+ dnl # Checks poll polling system #
823
+ dnl ################################################################################
824
+ AC_DEFUN([LIBZMQ_CHECK_POLLER_POLL], [{
825
+ AC_LINK_IFELSE(
826
+ [AC_LANG_PROGRAM(
827
+ [
828
+ #include <poll.h>
829
+ ],
830
+ [[
831
+ struct pollfd t_poll;
832
+ poll(&t_poll, 1, 1);
833
+ ]]
834
+ )],
835
+ [libzmq_cv_have_poller_poll="yes" ; $1],
836
+ [libzmq_cv_have_poller_poll="no" ; $2])
837
+ }])
838
+
839
+ dnl ################################################################################
840
+ dnl # LIBZMQ_CHECK_POLLER_SELECT([action-if-found], [action-if-not-found]) #
841
+ dnl # Checks select polling system #
842
+ dnl ################################################################################
843
+ AC_DEFUN([LIBZMQ_CHECK_POLLER_SELECT], [{
844
+ AC_LINK_IFELSE(
845
+ [AC_LANG_PROGRAM(
846
+ [
847
+ #ifdef ZMQ_HAVE_WINDOWS
848
+ #include "winsock2.h"
849
+ #elif defined ZMQ_HAVE_OPENVMS
850
+ #include <sys/types.h>
851
+ #include <sys/time.h>
852
+ #else
853
+ #include <sys/select.h>
854
+ #endif
855
+ ],
856
+ [[
857
+ fd_set t_rfds;
858
+ struct timeval tv;
859
+
860
+ FD_ZERO(&t_rfds);
861
+ FD_SET(0, &t_rfds);
862
+
863
+ tv.tv_sec = 5;
864
+ tv.tv_usec = 0;
865
+
866
+ select(1, &t_rfds, NULL, NULL, &tv);
867
+ ]]
868
+ )],
869
+ [libzmq_cv_have_poller_select="yes" ; $1],
870
+ [libzmq_cv_have_poller_select="no" ; $2])
871
+ }])
872
+
873
+ dnl ################################################################################
874
+ dnl # LIBZMQ_CHECK_POLLER([action-if-found], [action-if-not-found]) #
875
+ dnl # Choose polling system #
876
+ dnl ################################################################################
877
+ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{
878
+
879
+ # Allow user to disable doc build
880
+ AC_ARG_WITH([poller], [AS_HELP_STRING([--with-poller],
881
+ [choose polling system manually. valid values are kqueue, epoll, devpoll, poll or select [default=autodetect]])])
882
+
883
+ AC_MSG_CHECKING([for suitable polling system])
884
+
885
+ case "${with_poller}" in
886
+ kqueue|epoll|devpoll|poll|select)
887
+ # User has chosen polling system
888
+ libzmq_cv_poller="${with_poller}"
889
+ ;;
890
+
891
+ *)
892
+ # try to find suitable polling system. the order of testing is:
893
+ # kqueue -> epoll -> devpoll -> poll -> select
894
+ for subsystem in kqueue epoll devpoll poll select; do
895
+
896
+ case "${subsystem}" in
897
+ kqueue)
898
+ LIBZMQ_CHECK_POLLER_KQUEUE([libzmq_cv_poller=$subsystem], [])
899
+ ;;
900
+
901
+ epoll)
902
+ LIBZMQ_CHECK_POLLER_EPOLL([libzmq_cv_poller=$subsystem], [])
903
+ ;;
904
+
905
+ devpoll)
906
+ LIBZMQ_CHECK_POLLER_DEVPOLL([libzmq_cv_poller=$subsystem], [])
907
+ ;;
908
+
909
+ poll)
910
+ LIBZMQ_CHECK_POLLER_POLL([libzmq_cv_poller=$subsystem], [])
911
+ ;;
912
+
913
+ select)
914
+ LIBZMQ_CHECK_POLLER_SELECT([libzmq_cv_poller=$subsystem], [])
915
+ ;;
916
+ esac
917
+
918
+ if test "x${libzmq_cv_poller}" != "x"; then
919
+ break
920
+ fi
921
+ done
922
+ ;;
923
+ esac
924
+
925
+ libzmq_cv_poller_flag=`echo "ZMQ_FORCE_${libzmq_cv_poller}" | tr a-z A-Z`
926
+
927
+ AS_IF([test "x${libzmq_cv_poller}" != "x"],
928
+ [AC_MSG_RESULT([using $libzmq_cv_poller]) ; $1], [AC_MSG_RESULT(no suitable polling system found) ; $2])
929
+ }])
930
+