memcached 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. data/CHANGELOG +2 -0
  2. data/Manifest +206 -12
  3. data/Rakefile +32 -1
  4. data/ext/extconf.rb +10 -35
  5. data/ext/libmemcached-0.32/AUTHORS +7 -0
  6. data/ext/libmemcached-0.32/COPYING +32 -0
  7. data/ext/libmemcached-0.32/ChangeLog +303 -0
  8. data/ext/libmemcached-0.32/INSTALL +302 -0
  9. data/ext/libmemcached-0.32/Makefile.am +36 -0
  10. data/ext/libmemcached-0.32/Makefile.in +828 -0
  11. data/ext/libmemcached-0.32/NEWS +1 -0
  12. data/ext/libmemcached-0.32/README +33 -0
  13. data/ext/libmemcached-0.32/THANKS +14 -0
  14. data/ext/libmemcached-0.32/TODO +11 -0
  15. data/ext/libmemcached-0.32/aclocal.m4 +1852 -0
  16. data/ext/libmemcached-0.32/clients/Makefile.am +73 -0
  17. data/ext/libmemcached-0.32/clients/Makefile.in +770 -0
  18. data/ext/libmemcached-0.32/clients/client_options.h +32 -0
  19. data/ext/libmemcached-0.32/clients/execute.c +64 -0
  20. data/ext/libmemcached-0.32/clients/execute.h +5 -0
  21. data/ext/libmemcached-0.32/clients/generator.c +74 -0
  22. data/ext/libmemcached-0.32/clients/generator.h +20 -0
  23. data/ext/libmemcached-0.32/clients/memcat.c +178 -0
  24. data/ext/libmemcached-0.32/clients/memcp.c +251 -0
  25. data/ext/libmemcached-0.32/clients/memdump.c +170 -0
  26. data/ext/libmemcached-0.32/clients/memerror.c +80 -0
  27. data/ext/libmemcached-0.32/clients/memflush.c +143 -0
  28. data/ext/libmemcached-0.32/clients/memrm.c +160 -0
  29. data/ext/libmemcached-0.32/clients/memslap.c +441 -0
  30. data/ext/libmemcached-0.32/clients/memstat.c +326 -0
  31. data/ext/libmemcached-0.32/clients/utilities.c +207 -0
  32. data/ext/libmemcached-0.32/clients/utilities.h +41 -0
  33. data/ext/libmemcached-0.32/config.h.in +252 -0
  34. data/ext/libmemcached-0.32/config/compile +143 -0
  35. data/ext/libmemcached-0.32/config/config.guess +1561 -0
  36. data/ext/libmemcached-0.32/config/config.rpath +666 -0
  37. data/ext/libmemcached-0.32/config/config.sub +1686 -0
  38. data/ext/libmemcached-0.32/config/depcomp +630 -0
  39. data/ext/libmemcached-0.32/config/install-sh +520 -0
  40. data/ext/libmemcached-0.32/config/ltmain.sh +8406 -0
  41. data/ext/libmemcached-0.32/config/missing +376 -0
  42. data/ext/libmemcached-0.32/configure +23048 -0
  43. data/ext/libmemcached-0.32/configure.ac +122 -0
  44. data/ext/libmemcached-0.32/docs/Makefile.am +415 -0
  45. data/ext/libmemcached-0.32/docs/Makefile.in +918 -0
  46. data/ext/libmemcached-0.32/docs/libmemcached.pod +123 -0
  47. data/ext/libmemcached-0.32/docs/libmemcached_examples.pod +115 -0
  48. data/ext/libmemcached-0.32/docs/libmemcachedutil.pod +40 -0
  49. data/ext/libmemcached-0.32/docs/memcached_analyze.pod +52 -0
  50. data/ext/libmemcached-0.32/docs/memcached_auto.pod +97 -0
  51. data/ext/libmemcached-0.32/docs/memcached_behavior.pod +224 -0
  52. data/ext/libmemcached-0.32/docs/memcached_callback.pod +123 -0
  53. data/ext/libmemcached-0.32/docs/memcached_create.pod +61 -0
  54. data/ext/libmemcached-0.32/docs/memcached_delete.pod +54 -0
  55. data/ext/libmemcached-0.32/docs/memcached_dump.pod +53 -0
  56. data/ext/libmemcached-0.32/docs/memcached_flush.pod +46 -0
  57. data/ext/libmemcached-0.32/docs/memcached_flush_buffers.pod +42 -0
  58. data/ext/libmemcached-0.32/docs/memcached_generate_hash_value.pod +57 -0
  59. data/ext/libmemcached-0.32/docs/memcached_get.pod +161 -0
  60. data/ext/libmemcached-0.32/docs/memcached_memory_allocators.pod +73 -0
  61. data/ext/libmemcached-0.32/docs/memcached_pool.pod +77 -0
  62. data/ext/libmemcached-0.32/docs/memcached_quit.pod +47 -0
  63. data/ext/libmemcached-0.32/docs/memcached_sasl.pod +63 -0
  64. data/ext/libmemcached-0.32/docs/memcached_server_st.pod +75 -0
  65. data/ext/libmemcached-0.32/docs/memcached_servers.pod +102 -0
  66. data/ext/libmemcached-0.32/docs/memcached_set.pod +187 -0
  67. data/ext/libmemcached-0.32/docs/memcached_stats.pod +82 -0
  68. data/ext/libmemcached-0.32/docs/memcached_strerror.pod +46 -0
  69. data/ext/libmemcached-0.32/docs/memcached_user_data.pod +49 -0
  70. data/ext/libmemcached-0.32/docs/memcached_verbosity.pod +41 -0
  71. data/ext/libmemcached-0.32/docs/memcached_version.pod +56 -0
  72. data/ext/libmemcached-0.32/docs/memcat.pod +37 -0
  73. data/ext/libmemcached-0.32/docs/memcp.pod +40 -0
  74. data/ext/libmemcached-0.32/docs/memdump.pod +31 -0
  75. data/ext/libmemcached-0.32/docs/memerror.pod +30 -0
  76. data/ext/libmemcached-0.32/docs/memflush.pod +35 -0
  77. data/ext/libmemcached-0.32/docs/memrm.pod +34 -0
  78. data/ext/libmemcached-0.32/docs/memslap.pod +33 -0
  79. data/ext/libmemcached-0.32/docs/memstat.pod +35 -0
  80. data/ext/libmemcached-0.32/libmemcached/Makefile.am +107 -0
  81. data/ext/libmemcached-0.32/libmemcached/Makefile.in +1050 -0
  82. data/ext/libmemcached-0.32/libmemcached/byteorder.c +31 -0
  83. data/ext/libmemcached-0.32/libmemcached/common.h +183 -0
  84. data/ext/libmemcached-0.32/libmemcached/crc.c +86 -0
  85. data/ext/libmemcached-0.32/libmemcached/hsieh_hash.c +68 -0
  86. data/ext/libmemcached-0.32/libmemcached/jenkins_hash.c +213 -0
  87. data/ext/libmemcached-0.32/libmemcached/libmemcached.ver +1 -0
  88. data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.d +28 -0
  89. data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.h +78 -0
  90. data/ext/libmemcached-0.32/libmemcached/md5.c +354 -0
  91. data/ext/libmemcached-0.32/libmemcached/memcached.c +152 -0
  92. data/ext/libmemcached-0.32/libmemcached/memcached.h +302 -0
  93. data/ext/libmemcached-0.32/libmemcached/memcached.hpp +799 -0
  94. data/ext/libmemcached-0.32/libmemcached/memcached/README.txt +7 -0
  95. data/ext/libmemcached-0.32/libmemcached/memcached/protocol_binary.h +366 -0
  96. data/ext/libmemcached-0.32/libmemcached/memcached_allocators.c +72 -0
  97. data/ext/libmemcached-0.32/libmemcached/memcached_analyze.c +100 -0
  98. data/ext/libmemcached-0.32/libmemcached/memcached_auto.c +207 -0
  99. data/ext/libmemcached-0.32/libmemcached/memcached_behavior.c +285 -0
  100. data/ext/libmemcached-0.32/libmemcached/memcached_callback.c +175 -0
  101. data/ext/libmemcached-0.32/libmemcached/memcached_configure.h.in +23 -0
  102. data/ext/libmemcached-0.32/libmemcached/memcached_connect.c +361 -0
  103. data/ext/libmemcached-0.32/libmemcached/memcached_constants.h +145 -0
  104. data/ext/libmemcached-0.32/libmemcached/memcached_delete.c +0 -0
  105. data/ext/libmemcached-0.32/libmemcached/memcached_do.c +34 -0
  106. data/ext/libmemcached-0.32/libmemcached/memcached_dump.c +79 -0
  107. data/ext/libmemcached-0.32/libmemcached/memcached_fetch.c +102 -0
  108. data/ext/libmemcached-0.32/libmemcached/memcached_flush.c +89 -0
  109. data/ext/libmemcached-0.32/libmemcached/memcached_flush_buffers.c +22 -0
  110. data/ext/libmemcached-0.32/libmemcached/memcached_get.c +495 -0
  111. data/ext/libmemcached-0.32/libmemcached/memcached_get.h +87 -0
  112. data/ext/libmemcached-0.32/libmemcached/memcached_hash.c +252 -0
  113. data/ext/libmemcached-0.32/libmemcached/memcached_hosts.c +510 -0
  114. data/ext/libmemcached-0.32/libmemcached/memcached_internal.h +31 -0
  115. data/ext/libmemcached-0.32/libmemcached/memcached_io.c +547 -0
  116. data/ext/libmemcached-0.32/libmemcached/memcached_io.h +59 -0
  117. data/ext/libmemcached-0.32/libmemcached/memcached_key.c +28 -0
  118. data/ext/libmemcached-0.32/libmemcached/memcached_parse.c +74 -0
  119. data/ext/libmemcached-0.32/libmemcached/memcached_pool.h +38 -0
  120. data/ext/libmemcached-0.32/libmemcached/memcached_purge.c +76 -0
  121. data/ext/libmemcached-0.32/libmemcached/memcached_quit.c +75 -0
  122. data/ext/libmemcached-0.32/libmemcached/memcached_response.c +528 -0
  123. data/ext/libmemcached-0.32/libmemcached/memcached_result.c +57 -0
  124. data/ext/libmemcached-0.32/libmemcached/memcached_result.h +59 -0
  125. data/ext/libmemcached-0.32/libmemcached/memcached_sasl.c +225 -0
  126. data/ext/libmemcached-0.32/libmemcached/memcached_sasl.h +44 -0
  127. data/ext/libmemcached-0.32/libmemcached/memcached_server.c +159 -0
  128. data/ext/libmemcached-0.32/libmemcached/memcached_server.h +93 -0
  129. data/ext/libmemcached-0.32/libmemcached/memcached_stats.c +454 -0
  130. data/ext/libmemcached-0.32/libmemcached/memcached_storage.c +514 -0
  131. data/ext/libmemcached-0.32/libmemcached/memcached_storage.h +107 -0
  132. data/ext/libmemcached-0.32/libmemcached/memcached_strerror.c +92 -0
  133. data/ext/libmemcached-0.32/libmemcached/memcached_string.c +138 -0
  134. data/ext/libmemcached-0.32/libmemcached/memcached_string.h +53 -0
  135. data/ext/libmemcached-0.32/libmemcached/memcached_types.h +44 -0
  136. data/ext/libmemcached-0.32/libmemcached/memcached_util.h +15 -0
  137. data/ext/libmemcached-0.32/libmemcached/memcached_verbosity.c +36 -0
  138. data/ext/libmemcached-0.32/libmemcached/memcached_version.c +112 -0
  139. data/ext/libmemcached-0.32/libmemcached/memcached_watchpoint.h +38 -0
  140. data/ext/libmemcached-0.32/libmemcached/murmur_hash.c +76 -0
  141. data/ext/libmemcached-0.32/libmemcached/visibility.h +51 -0
  142. data/ext/libmemcached-0.32/libmemcachedutil/Makefile.am +11 -0
  143. data/ext/libmemcached-0.32/libmemcachedutil/Makefile.in +602 -0
  144. data/ext/libmemcached-0.32/libmemcachedutil/libmemcachedutil.ver +1 -0
  145. data/ext/libmemcached-0.32/libmemcachedutil/memcached_pool.c +170 -0
  146. data/ext/libmemcached-0.32/m4/ac_cxx_compile_stdcxx_0x.m4 +103 -0
  147. data/ext/libmemcached-0.32/m4/ac_cxx_header_stdcxx_98.m4 +67 -0
  148. data/ext/libmemcached-0.32/m4/acx_pthread.m4 +276 -0
  149. data/ext/libmemcached-0.32/m4/byteorder.m4 +40 -0
  150. data/ext/libmemcached-0.32/m4/deprecated.m4 +17 -0
  151. data/ext/libmemcached-0.32/m4/enable_utillib.m4 +16 -0
  152. data/ext/libmemcached-0.32/m4/extensions.m4 +94 -0
  153. data/ext/libmemcached-0.32/m4/hsieh.m4 +18 -0
  154. data/ext/libmemcached-0.32/m4/lib-prefix.m4 +221 -0
  155. data/ext/libmemcached-0.32/m4/libtool.m4 +7360 -0
  156. data/ext/libmemcached-0.32/m4/ltoptions.m4 +368 -0
  157. data/ext/libmemcached-0.32/m4/ltsugar.m4 +123 -0
  158. data/ext/libmemcached-0.32/m4/ltversion.m4 +23 -0
  159. data/ext/libmemcached-0.32/m4/lt~obsolete.m4 +92 -0
  160. data/ext/libmemcached-0.32/m4/memcached.m4 +30 -0
  161. data/ext/libmemcached-0.32/m4/pandora_64bit.m4 +55 -0
  162. data/ext/libmemcached-0.32/m4/pandora_canonical.m4 +151 -0
  163. data/ext/libmemcached-0.32/m4/pandora_check_compiler_version.m4 +37 -0
  164. data/ext/libmemcached-0.32/m4/pandora_check_cxx_standard.m4 +16 -0
  165. data/ext/libmemcached-0.32/m4/pandora_enable_dtrace.m4 +41 -0
  166. data/ext/libmemcached-0.32/m4/pandora_ensure_gcc_version.m4 +36 -0
  167. data/ext/libmemcached-0.32/m4/pandora_have_better_malloc.m4 +54 -0
  168. data/ext/libmemcached-0.32/m4/pandora_have_sasl.m4 +133 -0
  169. data/ext/libmemcached-0.32/m4/pandora_header_assert.m4 +23 -0
  170. data/ext/libmemcached-0.32/m4/pandora_libtool.m4 +15 -0
  171. data/ext/libmemcached-0.32/m4/pandora_optimize.m4 +79 -0
  172. data/ext/libmemcached-0.32/m4/pandora_shared_ptr.m4 +56 -0
  173. data/ext/libmemcached-0.32/m4/pandora_vc_build.m4 +32 -0
  174. data/ext/libmemcached-0.32/m4/pandora_warnings.m4 +262 -0
  175. data/ext/libmemcached-0.32/m4/pod2man.m4 +7 -0
  176. data/ext/libmemcached-0.32/m4/protocol_binary.m4 +23 -0
  177. data/ext/libmemcached-0.32/m4/setsockopt.m4 +57 -0
  178. data/ext/libmemcached-0.32/m4/visibility.m4 +52 -0
  179. data/ext/libmemcached-0.32/support/Makefile.am +4 -0
  180. data/ext/libmemcached-0.32/support/Makefile.in +485 -0
  181. data/ext/libmemcached-0.32/support/libmemcached-fc.spec.in +105 -0
  182. data/ext/libmemcached-0.32/support/libmemcached.pc.in +10 -0
  183. data/ext/libmemcached-0.32/support/libmemcached.spec +105 -0
  184. data/ext/libmemcached-0.32/support/libmemcached.spec.in +105 -0
  185. data/ext/libmemcached-0.32/support/set_benchmark.sh +5 -0
  186. data/ext/libmemcached-0.32/tests/Makefile.am +105 -0
  187. data/ext/libmemcached-0.32/tests/Makefile.in +748 -0
  188. data/ext/libmemcached-0.32/tests/atomsmasher.c +245 -0
  189. data/ext/libmemcached-0.32/tests/function.c +4781 -0
  190. data/ext/libmemcached-0.32/tests/ketama_test_cases.h +108 -0
  191. data/ext/libmemcached-0.32/tests/output.cmp +7 -0
  192. data/ext/libmemcached-0.32/tests/output.res +7 -0
  193. data/ext/libmemcached-0.32/tests/output2.res +46 -0
  194. data/ext/libmemcached-0.32/tests/plus.cpp +293 -0
  195. data/ext/libmemcached-0.32/tests/r/memcat.res +19 -0
  196. data/ext/libmemcached-0.32/tests/r/memcp.res +27 -0
  197. data/ext/libmemcached-0.32/tests/r/memrm.res +19 -0
  198. data/ext/libmemcached-0.32/tests/r/memslap.res +33 -0
  199. data/ext/libmemcached-0.32/tests/r/memstat.res +33 -0
  200. data/ext/libmemcached-0.32/tests/server.c +118 -0
  201. data/ext/libmemcached-0.32/tests/server.h +25 -0
  202. data/ext/libmemcached-0.32/tests/start.c +16 -0
  203. data/ext/libmemcached-0.32/tests/t/memcat.test +4 -0
  204. data/ext/libmemcached-0.32/tests/t/memcp.test +3 -0
  205. data/ext/libmemcached-0.32/tests/t/memrm.test +3 -0
  206. data/ext/libmemcached-0.32/tests/t/memslap.test +5 -0
  207. data/ext/libmemcached-0.32/tests/t/memstat.test +3 -0
  208. data/ext/libmemcached-0.32/tests/test.c +137 -0
  209. data/ext/libmemcached-0.32/tests/test.h +46 -0
  210. data/ext/libmemcached-0.32/tests/udp.c +76 -0
  211. data/memcached.gemspec +4 -4
  212. data/test/unit/memcached_test.rb +30 -0
  213. metadata +213 -16
  214. data/ext/libmemcached-0.32.tar.gz +0 -0
  215. data/ext/libmemcached-1.patch +0 -270
  216. data/ext/libmemcached-10.patch +0 -12
  217. data/ext/libmemcached-2.patch +0 -116
  218. data/ext/libmemcached-3.patch +0 -8
  219. data/ext/libmemcached-4.patch +0 -40
  220. data/ext/libmemcached-5.patch +0 -832
  221. data/ext/libmemcached-6.patch +0 -20
  222. data/ext/libmemcached-7.patch +0 -2989
  223. data/ext/libmemcached-8.patch +0 -137
  224. data/ext/libmemcached-9.patch +0 -13
  225. data/ext/sasl.patch +0 -29283
@@ -0,0 +1,36 @@
1
+ dnl Copyright (C) 2009 Sun Microsystems
2
+ dnl This file is free software; Sun Microsystems
3
+ dnl gives unlimited permission to copy and/or distribute it,
4
+ dnl with or without modifications, as long as this notice is preserved.
5
+
6
+ dnl If the user is on a Mac and didn't ask for a specific compiler
7
+ dnl You're gonna get 4.2.
8
+ AC_DEFUN([PANDORA_MAC_GCC42],
9
+ [AS_IF([test "$GCC" = "yes"],[
10
+ AS_IF([test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"],[
11
+ AS_IF([test -f /usr/bin/gcc-4.2],
12
+ [
13
+ CPP="/usr/bin/gcc-4.2 -E"
14
+ CC=/usr/bin/gcc-4.2
15
+ CXX=/usr/bin/g++-4.2
16
+ ])
17
+ ])
18
+ ])
19
+ ])
20
+
21
+ dnl
22
+ AC_DEFUN([PANDORA_ENSURE_GCC_VERSION],[
23
+ AC_REQUIRE([PANDORA_MAC_GCC42])
24
+ AC_CACHE_CHECK([if GCC is recent enough], [ac_cv_gcc_recent],
25
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
26
+ #if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
27
+ # error GCC is Too Old!
28
+ #endif
29
+ ]])],
30
+ [ac_cv_gcc_recent=yes],
31
+ [ac_cv_gcc_recent=no])])
32
+ AS_IF([test "$ac_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"],
33
+ AC_MSG_ERROR([Your version of GCC is too old. At least version 4.2 is required on OSX. You may need to install a version of XCode >= 3.1.2]))
34
+ AS_IF([test "$ac_cv_gcc_recent" = "no"],
35
+ AC_MSG_ERROR([Your version of GCC is too old. At least version 4.1 is required]))
36
+ ])
@@ -0,0 +1,54 @@
1
+ dnl Copyright (C) 2009 Sun Microsystems
2
+ dnl This file is free software; Sun Microsystems
3
+ dnl gives unlimited permission to copy and/or distribute it,
4
+ dnl with or without modifications, as long as this notice is preserved.
5
+
6
+ AC_DEFUN([PANDORA_HAVE_BETTER_MALLOC],[
7
+ AC_REQUIRE([AC_FUNC_MALLOC])
8
+ AC_REQUIRE([AC_FUNC_REALLOC])
9
+ AC_REQUIRE([AC_LIB_PREFIX])
10
+
11
+ AC_ARG_ENABLE([umem],
12
+ [AS_HELP_STRING([--enable-umem],
13
+ [Enable linking with libumem @<:@default=off@:>@])],
14
+ [ac_enable_umem="$enableval"],
15
+ [ac_enable_umem="no"])
16
+
17
+ AC_ARG_ENABLE([tcmalloc],
18
+ [AS_HELP_STRING([--enable-tcmalloc],
19
+ [Enable linking with tcmalloc @<:@default=off@:>@])],
20
+ [ac_enable_tcmalloc="$enableval"],
21
+ [ac_enable_tcmalloc="no"])
22
+
23
+ AC_ARG_ENABLE([mtmalloc],
24
+ [AS_HELP_STRING([--disable-mtmalloc],
25
+ [Enable linking with mtmalloc @<:@default=on@:>@])],
26
+ [ac_enable_mtmalloc="$enableval"],
27
+ [ac_enable_mtmalloc="yes"])
28
+
29
+ save_LIBS="${LIBS}"
30
+ LIBS=
31
+ AS_IF([test "x$ac_enable_umem" = "xyes"],[
32
+ AC_CHECK_LIB(umem,malloc,[],[])
33
+ ],[
34
+ case "$target_os" in
35
+ *linux*)
36
+ AS_IF([test "x$ac_enable_tcmalloc" != "xno"],[
37
+ AC_CHECK_LIB(tcmalloc-minimal,malloc,[],[])
38
+ AS_IF([test "x$ac_cv_lib_tcmalloc_minimal_malloc" != "xyes"],[
39
+ AC_CHECK_LIB(tcmalloc,malloc,[],[])
40
+ ])
41
+ ])
42
+ ;;
43
+ *solaris*)
44
+ AS_IF([test "x$ac_enable_mtmalloc" != "xno"],[
45
+ AC_CHECK_LIB(mtmalloc,malloc,[],[])
46
+ ])
47
+ ;;
48
+ esac
49
+ ])
50
+ BETTER_MALLOC_LIBS="${LIBS}"
51
+ LIBS="${save_LIBS}"
52
+ AC_SUBST([BETTER_MALLOC_LIBS])
53
+
54
+ ])
@@ -0,0 +1,133 @@
1
+ dnl Copyright (C) 2009 Sun Microsystems
2
+ dnl This file is free software; Sun Microsystems
3
+ dnl gives unlimited permission to copy and/or distribute it,
4
+ dnl with or without modifications, as long as this notice is preserved.
5
+
6
+ AC_DEFUN([_PANDORA_SEARCH_SASL],[
7
+ AC_REQUIRE([AC_LIB_PREFIX])
8
+
9
+ dnl --------------------------------------------------------------------
10
+ dnl Check for sasl
11
+ dnl --------------------------------------------------------------------
12
+ AC_ARG_ENABLE([sasl],
13
+ [AS_HELP_STRING([--disable-sasl],
14
+ [Build with sasl support @<:@default=on@:>@])],
15
+ [ac_enable_sasl="$enableval"],
16
+ [ac_enable_sasl="yes"])
17
+
18
+ AS_IF([test "x$ac_enable_sasl" = "xyes"],
19
+ [
20
+ AC_LIB_HAVE_LINKFLAGS(sasl,,[
21
+ #include <stdlib.h>
22
+ #include <sasl/sasl.h>
23
+ ],[
24
+ sasl_server_init(NULL, NULL);
25
+ ])
26
+
27
+ AS_IF([test "x${ac_cv_libsasl}" != "xyes" ],
28
+ [
29
+ AC_LIB_HAVE_LINKFLAGS(sasl2,,[
30
+ #include <stdlib.h>
31
+ #include <sasl/sasl.h>
32
+ ],[
33
+ sasl_server_init(NULL, NULL);
34
+ ])
35
+ HAVE_LIBSASL="$HAVE_LIBSASL2"
36
+ LIBSASL="$LIBSASL2"
37
+ LIBSASL_PREFIX="$LIBSASL2_PREFIX"
38
+ LTLIBSASL="$LT_LIBSASL2"
39
+ ])
40
+ ])
41
+
42
+ AS_IF([test "x${ac_cv_libsasl}" = "xyes" -o "x${ac_cv_libsasl2}" = "xyes"],
43
+ [ac_cv_sasl=yes],
44
+ [ac_cv_sasl=no])
45
+
46
+ AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
47
+ AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
48
+ AM_CONDITIONAL(HAVE_SASL, [test "x${ac_cv_sasl}" = "xyes"])
49
+ ])
50
+
51
+ AC_DEFUN([PANDORA_HAVE_SASL],[
52
+ AC_REQUIRE([_PANDORA_SEARCH_SASL])
53
+ ])
54
+
55
+ AC_DEFUN([PANDORA_REQUIRE_SASL],[
56
+ AC_REQUIRE([_PANDORA_SEARCH_SASL])
57
+ AS_IF([test "x${ac_cv_sasl}" = "xno"],
58
+ AC_MSG_ERROR([SASL (libsasl or libsasl2) is required for ${PACKAGE}]))
59
+ ])
60
+
61
+ AC_DEFUN([_PANDORA_SEARCH_LIBSASL],[
62
+ AC_REQUIRE([AC_LIB_PREFIX])
63
+
64
+ dnl --------------------------------------------------------------------
65
+ dnl Check for libsasl
66
+ dnl --------------------------------------------------------------------
67
+
68
+ AC_ARG_ENABLE([libsasl],
69
+ [AS_HELP_STRING([--disable-libsasl],
70
+ [Build with libsasl support @<:@default=on@:>@])],
71
+ [ac_enable_libsasl="$enableval"],
72
+ [ac_enable_libsasl="yes"])
73
+
74
+ AS_IF([test "x$ac_enable_libsasl" = "xyes"],[
75
+ AC_LIB_HAVE_LINKFLAGS(sasl,,[
76
+ #include <stdlib.h>
77
+ #include <sasl/sasl.h>
78
+ ],[
79
+ sasl_server_init(NULL, NULL);
80
+ ])
81
+ ],[
82
+ ac_cv_libsasl="no"
83
+ ])
84
+
85
+ AM_CONDITIONAL(HAVE_LIBSASL, [test "x${ac_cv_libsasl}" = "xyes"])
86
+ ])
87
+
88
+ AC_DEFUN([PANDORA_HAVE_LIBSASL],[
89
+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
90
+ ])
91
+
92
+ AC_DEFUN([PANDORA_REQUIRE_LIBSASL],[
93
+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL])
94
+ AS_IF([test "x${ac_cv_libsasl}" = "xno"],
95
+ AC_MSG_ERROR([libsasl is required for ${PACKAGE}]))
96
+ ])
97
+
98
+ AC_DEFUN([_PANDORA_SEARCH_LIBSASL2],[
99
+ AC_REQUIRE([AC_LIB_PREFIX])
100
+
101
+ dnl --------------------------------------------------------------------
102
+ dnl Check for libsasl2
103
+ dnl --------------------------------------------------------------------
104
+
105
+ AC_ARG_ENABLE([libsasl2],
106
+ [AS_HELP_STRING([--disable-libsasl2],
107
+ [Build with libsasl2 support @<:@default=on@:>@])],
108
+ [ac_enable_libsasl2="$enableval"],
109
+ [ac_enable_libsasl2="yes"])
110
+
111
+ AS_IF([test "x$ac_enable_libsasl2" = "xyes"],[
112
+ AC_LIB_HAVE_LINKFLAGS(sasl2,,[
113
+ #include <stdlib.h>
114
+ #include <sasl2/sasl2.h>
115
+ ],[
116
+ sasl2_server_init(NULL, NULL);
117
+ ])
118
+ ],[
119
+ ac_cv_libsasl2="no"
120
+ ])
121
+
122
+ AM_CONDITIONAL(HAVE_LIBSASL2, [test "x${ac_cv_libsasl2}" = "xyes"])
123
+ ])
124
+
125
+ AC_DEFUN([PANDORA_HAVE_LIBSASL2],[
126
+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
127
+ ])
128
+
129
+ AC_DEFUN([PANDORA_REQUIRE_LIBSASL2],[
130
+ AC_REQUIRE([_PANDORA_SEARCH_LIBSASL2])
131
+ AS_IF([test "x${ac_cv_libsasl2}" = "xno"],
132
+ AC_MSG_ERROR([libsasl2 is required for ${PACKAGE}]))
133
+ ])
@@ -0,0 +1,23 @@
1
+ dnl Copyright (C) 2009 Sun Microsystems
2
+ dnl This file is free software; Sun Microsystems
3
+ dnl gives unlimited permission to copy and/or distribute it,
4
+ dnl with or without modifications, as long as this notice is preserved.
5
+
6
+ dnl PANDORA_HEADER_ASSERT
7
+ dnl ----------------
8
+ dnl Check whether to enable assertions.
9
+ AC_DEFUN([PANDORA_HEADER_ASSERT],
10
+ [
11
+ AC_MSG_CHECKING([whether to enable assertions])
12
+ AC_ARG_ENABLE([assert],
13
+ [AS_HELP_STRING([--disable-assert],
14
+ [Turn off assertions])],
15
+ [ac_cv_assert="no"],
16
+ [ac_cv_assert="yes"])
17
+ AC_MSG_RESULT([$ac_cv_assert])
18
+
19
+ AS_IF([test "$ac_cv_assert" = "yes"],
20
+ [AC_CHECK_HEADERS(assert.h)],
21
+ [AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])])
22
+ ])
23
+
@@ -0,0 +1,15 @@
1
+ dnl Copyright (C) 2009 Sun Microsystems
2
+ dnl This file is free software; Sun Microsystems
3
+ dnl gives unlimited permission to copy and/or distribute it,
4
+ dnl with or without modifications, as long as this notice is preserved.
5
+
6
+ AC_DEFUN([PANDORA_LIBTOOL],[
7
+ AC_REQUIRE([AC_PROG_LIBTOOL])
8
+ dnl By requiring AC_PROG_LIBTOOL, we should force the macro system to read
9
+ dnl libtool.m4, where in 2.2 AC_PROG_LIBTOOL is an alias for LT_INIT
10
+ dnl Then, if we're on 2.2, we should have LT_LANG, so we'll call it.
11
+ m4_ifdef([LT_LANG],[
12
+ LT_LANG(C)
13
+ LT_LANG(C++)
14
+ ])
15
+ ])
@@ -0,0 +1,79 @@
1
+ dnl Copyright (C) 2009 Sun Microsystems
2
+ dnl This file is free software; Sun Microsystems
3
+ dnl gives unlimited permission to copy and/or distribute it,
4
+ dnl with or without modifications, as long as this notice is preserved.
5
+
6
+ AC_DEFUN([PANDORA_OPTIMIZE],[
7
+ dnl Build optimized or debug version ?
8
+ dnl First check for gcc and g++
9
+ AS_IF([test "$GCC" = "yes" -a "$INTELCC" = "no"],[
10
+
11
+ dnl The following is required for portable results of floating point
12
+ dnl calculations on PowerPC. The same must also be done for IA-64, but
13
+ dnl this options is missing in the IA-64 gcc backend.
14
+ case "$target_cpu" in
15
+ *ppc* | *powerpc*)
16
+ AM_CFLAGS="-mno-fused-madd ${AM_CFLAGS}"
17
+ AM_CXXFLAGS="-mno-fused-madd ${AM_CXXFLAGS}"
18
+ ;;
19
+ esac
20
+
21
+ dnl Once we can use a modern autoconf, we can replace the std=gnu99 here
22
+ dnl with using AC_CC_STD_C99 above
23
+ CC="${CC} -std=gnu99"
24
+
25
+ AM_CPPFLAGS="-ggdb3 ${AM_CPPFLAGS}"
26
+
27
+ DEBUG_CFLAGS="-O0"
28
+ DEBUG_CXXFLAGS="-O0"
29
+
30
+ OPTIMIZE_CFLAGS="-O3"
31
+ OPTIMIZE_CXXFLAGS="-O3"
32
+ ])
33
+ AS_IF([test "$INTELCC" = "yes"],[
34
+ dnl Once we can use a modern autoconf, we can replace the std=gnu99 here
35
+ dnl with using AC_CC_STD_C99 above
36
+ CC="${CC} -std=c99"
37
+
38
+ AM_CPPFLAGS="-g ${AM_CPPFLAGS}"
39
+
40
+ DEBUG_CFLAGS="-O0"
41
+ DEBUG_CXXFLAGS="-O0"
42
+
43
+ OPTIMIZE_CFLAGS="-xHOST -O3 -no-prec-div -static"
44
+ OPTIMIZE_CXXFLAGS="${OPTIMIZE_CFLAGS}"
45
+
46
+ ])
47
+ AS_IF([test "$SUNCC" = "yes"],[
48
+ dnl Once we can use a modern autoconf, we can replace the -xc99=all here
49
+ dnl with using AC_CC_STD_C99 above
50
+ CC="${CC} -xc99=all"
51
+ CXX="${CXX} -xlang=c99"
52
+
53
+ AM_CFLAGS="-g -mt -xstrconst -Xa ${AM_CFLAGS}"
54
+ AM_CXXFLAGS="-mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}"
55
+
56
+ DEBUG_CXXFLAGS="-g"
57
+
58
+ dnl TODO: Make a test for -xO4 usability here
59
+ OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend -xbuiltin"
60
+ OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS}"
61
+ OPTIMIZE_CXXFLAGS="-g0 ${OPTIMIZE_FLAGS}"
62
+
63
+ ])
64
+
65
+ AC_ARG_WITH([debug],
66
+ [AS_HELP_STRING([--with-debug],
67
+ [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])],
68
+ [with_debug=$withval],
69
+ [with_debug=no])
70
+ AS_IF([test "$with_debug" = "yes"],[
71
+ # Debugging. No optimization.
72
+ AM_CFLAGS="${AM_CFLAGS} ${DEBUG_CFLAGS} -DDEBUG"
73
+ AM_CXXFLAGS="${AM_CXXFLAGS} ${DEBUG_CXXFLAGS} -DDEBUG"
74
+ ],[
75
+ # Optimized version. No debug
76
+ AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}"
77
+ AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}"
78
+ ])
79
+ ])
@@ -0,0 +1,56 @@
1
+ dnl Copyright (C) 2009 Sun Microsystems
2
+ dnl This file is free software; Sun Microsystems
3
+ dnl gives unlimited permission to copy and/or distribute it,
4
+ dnl with or without modifications, as long as this notice is preserved.
5
+
6
+ dnl We check two things: where is the memory include file, and in what
7
+ dnl namespace does shared_ptr reside.
8
+ dnl We include AC_COMPILE_IFELSE for all the combinations we've seen in the
9
+ dnl wild:
10
+ dnl
11
+ dnl GCC 4.3: namespace: std:: #include <memory>
12
+ dnl GCC 4.2: namespace: tr1:: #include <tr1/memory>
13
+ dnl GCC 4.2: namespace: boost:: #include <boost/shared_ptr.hpp>
14
+ dnl
15
+ dnl We define one of HAVE_HAVE_TR1_SHARED_PTR or HAVE_BOOST_SHARED_PTR
16
+ dnl depending on location, and SHARED_PTR_NAMESPACE to be the namespace in
17
+ dnl which shared_ptr is defined.
18
+ dnl
19
+
20
+ AC_DEFUN([PANDORA_SHARED_PTR],[
21
+ AC_REQUIRE([PANDORA_CHECK_CXX_STANDARD])
22
+ AC_LANG_PUSH(C++)
23
+ AC_CHECK_HEADERS(memory tr1/memory boost/shared_ptr.hpp)
24
+ AC_CACHE_CHECK([the location of shared_ptr header file],
25
+ [ac_cv_shared_ptr_h],[
26
+ for namespace in std tr1 std::tr1 boost
27
+ do
28
+ AC_COMPILE_IFELSE(
29
+ [AC_LANG_PROGRAM([[
30
+ #if defined(HAVE_MEMORY)
31
+ # include <memory>
32
+ #endif
33
+ #if defined(HAVE_TR1_MEMORY)
34
+ # include <tr1/memory>
35
+ #endif
36
+ #if defined(HAVE_BOOST_SHARED_PTR_HPP)
37
+ # include <boost/shared_ptr.hpp>
38
+ #endif
39
+ #include <string>
40
+
41
+ using $namespace::shared_ptr;
42
+ using namespace std;
43
+ ]],[[
44
+ shared_ptr<string> test_ptr(new string("test string"));
45
+ ]])],
46
+ [
47
+ ac_cv_shared_ptr_namespace="${namespace}"
48
+ break
49
+ ],[ac_cv_shared_ptr_namespace=missing])
50
+ done
51
+ ])
52
+ AC_DEFINE_UNQUOTED([SHARED_PTR_NAMESPACE],
53
+ ${ac_cv_shared_ptr_namespace},
54
+ [The namespace in which SHARED_PTR can be found])
55
+ AC_LANG_POP()
56
+ ])
@@ -0,0 +1,32 @@
1
+ dnl Copyright (C) 2009 Sun Microsystems
2
+ dnl This file is free software; Sun Microsystems
3
+ dnl gives unlimited permission to copy and/or distribute it,
4
+ dnl with or without modifications, as long as this notice is preserved.
5
+
6
+ AC_DEFUN([PANDORA_BUILDING_FROM_VC],[
7
+
8
+ ac_cv_building_from_vc=no
9
+
10
+ AS_IF([test -d "${srcdir}/.bzr"],[
11
+ ac_cv_building_from_bzr=yes
12
+ ac_cv_building_from_vc=yes
13
+ ],[
14
+ ac_cv_building_from_bzr=no
15
+ ])
16
+
17
+ AS_IF([test -d "${srcdir}/.svn"],[
18
+ ac_cv_building_from_svn=yes
19
+ ac_cv_building_from_vc=yes
20
+ ],[
21
+ ac_cv_building_from_svn=no
22
+ ])
23
+
24
+ AS_IF([test -d "${srcdir}/.hg"],[
25
+ ac_cv_building_from_hg=yes
26
+ ac_cv_building_from_vc=yes
27
+ ],[
28
+ ac_cv_building_from_hg=no
29
+ ])
30
+
31
+ ])
32
+
@@ -0,0 +1,262 @@
1
+ dnl Copyright (C) 2009 Sun Microsystems
2
+ dnl This file is free software; Sun Microsystems
3
+ dnl gives unlimited permission to copy and/or distribute it,
4
+ dnl with or without modifications, as long as this notice is preserved.
5
+
6
+ dnl AC_PANDORA_WARNINGS([less-warnings|warnings-always-on])
7
+ dnl less-warnings turn on a limited set of warnings
8
+ dnl warnings-always-on always set warnings=error regardless of tarball/vc
9
+
10
+ dnl @TODO: remove less-warnings option as soon as Drizzle is clean enough to
11
+ dnl allow it
12
+
13
+ AC_DEFUN([PANDORA_WARNINGS],[
14
+ m4_define([PW_LESS_WARNINGS],[no])
15
+ m4_define([PW_WARN_ALWAYS_ON],[no])
16
+ ifdef([m4_define],,[define([m4_define], defn([define]))])
17
+ ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))])
18
+ m4_foreach([pw_arg],[$*],[
19
+ m4_case(pw_arg,
20
+ [less-warnings],[
21
+ m4_undefine([PW_LESS_WARNINGS])
22
+ m4_define([PW_LESS_WARNINGS],[yes])
23
+ ],
24
+ [warnings-always-on],[
25
+ m4_undefine([PW_WARN_ALWAYS_ON])
26
+ m4_define([PW_WARN_ALWAYS_ON],[yes])
27
+ ])
28
+ ])
29
+
30
+ AC_REQUIRE([PANDORA_BUILDING_FROM_VC])
31
+ m4_if(PW_WARN_ALWAYS_ON, [yes],
32
+ [ac_cv_warnings_as_errors=yes],
33
+ AS_IF([test "$ac_cv_building_from_vc" = "yes"],
34
+ [ac_cv_warnings_as_errors=yes],
35
+ [ac_cv_warnings_as_errors=no]))
36
+
37
+ AC_ARG_ENABLE([profiling],
38
+ [AS_HELP_STRING([--enable-profiling],
39
+ [Toggle profiling @<:@default=off@:>@])],
40
+ [ac_profiling="$enableval"],
41
+ [ac_profiling="no"])
42
+
43
+ AC_ARG_ENABLE([coverage],
44
+ [AS_HELP_STRING([--enable-coverage],
45
+ [Toggle coverage @<:@default=off@:>@])],
46
+ [ac_coverage="$enableval"],
47
+ [ac_coverage="no"])
48
+
49
+ AS_IF([test "$GCC" = "yes"],[
50
+
51
+ AS_IF([test "$ac_profiling" = "yes"],[
52
+ CC_PROFILING="-pg"
53
+ save_LIBS="${LIBS}"
54
+ LIBS=""
55
+ AC_CHECK_LIB(c_p, read)
56
+ LIBC_P="${LIBS}"
57
+ LIBS="${save_LIBS}"
58
+ AC_SUBST(LIBC_P)
59
+ ],[
60
+ CC_PROFILING=" "
61
+ ])
62
+
63
+ AS_IF([test "$ac_coverage" = "yes"],
64
+ [CC_COVERAGE="-fprofile-arcs -ftest-coverage"])
65
+
66
+ AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
67
+ [W_FAIL="-Werror"])
68
+
69
+ AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
70
+ [ac_cv_safe_to_use_fdiagnostics_show_option_],
71
+ [save_CFLAGS="$CFLAGS"
72
+ CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS} ${CFLAGS}"
73
+ AC_COMPILE_IFELSE(
74
+ [AC_LANG_PROGRAM([],[])],
75
+ [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
76
+ [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
77
+ CFLAGS="$save_CFLAGS"])
78
+
79
+ AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
80
+ [
81
+ F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
82
+ ])
83
+
84
+ AC_CACHE_CHECK([whether it is safe to use -Wconversion],
85
+ [ac_cv_safe_to_use_wconversion_],
86
+ [save_CFLAGS="$CFLAGS"
87
+ dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
88
+ dnl conversion warnings to all the tarball folks
89
+ CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
90
+ AC_COMPILE_IFELSE(
91
+ [AC_LANG_PROGRAM([[
92
+ #include <stdbool.h>
93
+ void foo(bool a)
94
+ {
95
+ (void)a;
96
+ }
97
+ ]],[[
98
+ foo(0);
99
+ ]])],
100
+ [ac_cv_safe_to_use_wconversion_=yes],
101
+ [ac_cv_safe_to_use_wconversion_=no])
102
+ CFLAGS="$save_CFLAGS"])
103
+
104
+ AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
105
+ [W_CONVERSION="-Wconversion"
106
+ AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
107
+ [ac_cv_safe_to_use_Wconversion_],
108
+ [save_CFLAGS="$CFLAGS"
109
+ dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
110
+ dnl conversion warnings to all the tarball folks
111
+ CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
112
+ AC_COMPILE_IFELSE(
113
+ [AC_LANG_PROGRAM(
114
+ [[
115
+ #include <netinet/in.h>
116
+ ]],[[
117
+ uint16_t x= htons(80);
118
+ ]])],
119
+ [ac_cv_safe_to_use_Wconversion_=yes],
120
+ [ac_cv_safe_to_use_Wconversion_=no])
121
+ CFLAGS="$save_CFLAGS"])
122
+
123
+ AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
124
+ [NO_CONVERSION="-Wno-conversion"])
125
+ ])
126
+
127
+ NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
128
+ NO_SHADOW="-Wno-shadow"
129
+
130
+ AS_IF([test "$INTELCC" = "yes"],[
131
+ m4_if(PW_LESS_WARNINGS,[no],[
132
+ BASE_WARNINGS="-w1 -Wall -Werror -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual"
133
+ ],[
134
+ BASE_WARNINGS="-w1 -Wall -Wcheck -Wformat -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 981"
135
+ ])
136
+ CC_WARNINGS="${BASE_WARNINGS}"
137
+ CXX_WARNINGS="${BASE_WARNINGS}"
138
+ ],[
139
+ m4_if(PW_LESS_WARNINGS,[no],[
140
+ BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing"
141
+ CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
142
+ CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
143
+ ],[
144
+ BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}"
145
+ ])
146
+
147
+ AS_IF([test "${ac_cv_assert}" = "no"],
148
+ [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
149
+
150
+ BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}"
151
+ CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}"
152
+ CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}"
153
+
154
+ AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++],
155
+ [ac_cv_safe_to_use_Wmissing_declarations_],
156
+ [AC_LANG_PUSH(C++)
157
+ save_CXXFLAGS="$CXXFLAGS"
158
+ CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}"
159
+ AC_COMPILE_IFELSE([
160
+ AC_LANG_PROGRAM(
161
+ [[
162
+ #include <stdio.h>
163
+ ]], [[]])
164
+ ],
165
+ [ac_cv_safe_to_use_Wmissing_declarations_=yes],
166
+ [ac_cv_safe_to_use_Wmissing_declarations_=no])
167
+ CXXFLAGS="$save_CXXFLAGS"
168
+ AC_LANG_POP()
169
+ ])
170
+ AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"],
171
+ [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"])
172
+
173
+ AC_CACHE_CHECK([whether it is safe to use -Wlogical-op],
174
+ [ac_cv_safe_to_use_Wlogical_op_],
175
+ [save_CFLAGS="$CFLAGS"
176
+ CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS} ${CFLAGS}"
177
+ AC_COMPILE_IFELSE([
178
+ AC_LANG_PROGRAM(
179
+ [[
180
+ #include <stdio.h>
181
+ ]], [[]])
182
+ ],
183
+ [ac_cv_safe_to_use_Wlogical_op_=yes],
184
+ [ac_cv_safe_to_use_Wlogical_op_=no])
185
+ CFLAGS="$save_CFLAGS"])
186
+ AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"],
187
+ [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"])
188
+
189
+ AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++],
190
+ [ac_cv_safe_to_use_Wredundant_decls_],
191
+ [AC_LANG_PUSH(C++)
192
+ save_CXXFLAGS="${CXXFLAGS}"
193
+ CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}"
194
+ AC_COMPILE_IFELSE(
195
+ [AC_LANG_PROGRAM([
196
+ template <typename E> struct C { void foo(); };
197
+ template <typename E> void C<E>::foo() { }
198
+ template <> void C<int>::foo();
199
+ AC_INCLUDES_DEFAULT])],
200
+ [ac_cv_safe_to_use_Wredundant_decls_=yes],
201
+ [ac_cv_safe_to_use_Wredundant_decls_=no])
202
+ CXXFLAGS="${save_CXXFLAGS}"
203
+ AC_LANG_POP()])
204
+ AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"],
205
+ [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
206
+ [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
207
+
208
+ NO_REDUNDANT_DECLS="-Wno-redundant-decls"
209
+ PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow"
210
+
211
+ ])
212
+ ])
213
+
214
+ AS_IF([test "$SUNCC" = "yes"],[
215
+
216
+ AS_IF([test "$ac_profiling" = "yes"],
217
+ [CC_PROFILING="-xinstrument=datarace"])
218
+
219
+ AS_IF([test "$ac_cv_warnings_as_errors" = "yes"],
220
+ [W_FAIL="-errwarn=%all"])
221
+
222
+ AC_CACHE_CHECK([whether E_PASTE_RESULT_NOT_TOKEN is usable],
223
+ [ac_cv_paste_result],
224
+ [
225
+ save_CFLAGS="${CFLAGS}"
226
+ CFLAGS="-errwarn=%all -erroff=E_PASTE_RESULT_NOT_TOKEN ${CFLAGS}"
227
+ AC_COMPILE_IFELSE(
228
+ [AC_LANG_PROGRAM([
229
+ AC_INCLUDES_DEFAULT
230
+ ],[
231
+ int x= 0;])],
232
+ [ac_cv_paste_result=yes],
233
+ [ac_cv_paste_result=no])
234
+ CFLAGS="${save_CFLAGS}"
235
+ ])
236
+ AS_IF([test $ac_cv_paste_result = yes],
237
+ [W_PASTE_RESULT=",E_PASTE_RESULT_NOT_TOKEN"])
238
+
239
+
240
+ m4_if(PW_LESS_WARNINGS, [no],[
241
+ CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}"
242
+ CXX_WARNINGS_FULL="-erroff=inllargeuse"
243
+ ],[
244
+ CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR"
245
+ CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint"
246
+ ])
247
+
248
+ CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}"
249
+ CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}"
250
+ PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
251
+ NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
252
+
253
+ ])
254
+
255
+ AC_SUBST(NO_CONVERSION)
256
+ AC_SUBST(NO_REDUNDANT_DECLS)
257
+ AC_SUBST(NO_UNREACHED)
258
+ AC_SUBST(NO_SHADOW)
259
+ AC_SUBST(NO_STRICT_ALIASING)
260
+ AC_SUBST(PROTOSKIP_WARNINGS)
261
+
262
+ ])