0001-acinclude.m4-make-kernel-specific-flags-cacheable.patch 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. commit 9daf6dd7c4947ce74ca729de5c3cfe8cbc304702
  2. Author: Lionel Orry <lionel.orry@gmail.com>
  3. Date: Fri Feb 6 15:11:07 2015 +0100
  4. acinclude.m4: make kernel-specific flags cacheable
  5. Specifically when cross-compiling, one can be willing to force these
  6. variable values using the environment of a config.cache file. This
  7. commit makes this possible.
  8. The affected variables are:
  9. * libzmq_cv_sock_cloexec
  10. * libzmq_cv_so_keepalive
  11. * libzmq_cv_tcp_keepcnt
  12. * libzmq_cv_tcp_keepidle
  13. * libzmq_cv_tcp_keepintvl
  14. * libzmq_cv_tcp_keepalive
  15. Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
  16. diff --git a/acinclude.m4 b/acinclude.m4
  17. index 4bbd19e..456740d 100644
  18. --- a/acinclude.m4
  19. +++ b/acinclude.m4
  20. @@ -586,8 +586,8 @@ dnl # LIBZMQ_CHECK_SOCK_CLOEXEC([action-if-found], [action-if-not-found])
  21. dnl # Check if SOCK_CLOEXEC is supported #
  22. dnl ################################################################################
  23. AC_DEFUN([LIBZMQ_CHECK_SOCK_CLOEXEC], [{
  24. - AC_MSG_CHECKING(whether SOCK_CLOEXEC is supported)
  25. - AC_TRY_RUN([/* SOCK_CLOEXEC test */
  26. + AC_CACHE_CHECK([whether SOCK_CLOEXEC is supported], [libzmq_cv_sock_cloexec],
  27. + [AC_TRY_RUN([/* SOCK_CLOEXEC test */
  28. #include <sys/types.h>
  29. #include <sys/socket.h>
  30. @@ -596,11 +596,13 @@ int main (int argc, char *argv [])
  31. int s = socket (PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
  32. return (s == -1);
  33. }
  34. - ],
  35. - [AC_MSG_RESULT(yes) ; libzmq_cv_sock_cloexec="yes" ; $1],
  36. - [AC_MSG_RESULT(no) ; libzmq_cv_sock_cloexec="no" ; $2],
  37. - [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_sock_cloexec="no"]
  38. + ],
  39. + [libzmq_cv_sock_cloexec="yes"],
  40. + [libzmq_cv_sock_cloexec="no"],
  41. + [libzmq_cv_sock_cloexec="not during cross-compile"]
  42. + )]
  43. )
  44. + AS_IF([test "x$libzmq_cv_sock_cloexec" = "xyes"], [$1], [$2])
  45. }])
  46. dnl ################################################################################
  47. @@ -628,8 +630,8 @@ dnl # LIBZMQ_CHECK_SO_KEEPALIVE([action-if-found], [action-if-not-found])
  48. dnl # Check if SO_KEEPALIVE is supported #
  49. dnl ################################################################################
  50. AC_DEFUN([LIBZMQ_CHECK_SO_KEEPALIVE], [{
  51. - AC_MSG_CHECKING(whether SO_KEEPALIVE is supported)
  52. - AC_TRY_RUN([/* SO_KEEPALIVE test */
  53. + AC_CACHE_CHECK([whether SO_KEEPALIVE is supported], [libzmq_cv_so_keepalive],
  54. + [AC_TRY_RUN([/* SO_KEEPALIVE test */
  55. #include <sys/types.h>
  56. #include <sys/socket.h>
  57. @@ -641,11 +643,13 @@ int main (int argc, char *argv [])
  58. ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
  59. );
  60. }
  61. - ],
  62. - [AC_MSG_RESULT(yes) ; libzmq_cv_so_keepalive="yes" ; $1],
  63. - [AC_MSG_RESULT(no) ; libzmq_cv_so_keepalive="no" ; $2],
  64. - [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_so_keepalive="no"]
  65. + ],
  66. + [libzmq_cv_so_keepalive="yes"],
  67. + [libzmq_cv_so_keepalive="no"],
  68. + [libzmq_cv_so_keepalive="not during cross-compile"]
  69. + )]
  70. )
  71. + AS_IF([test "x$libzmq_cv_so_keepalive" = "xyes"], [$1], [$2])
  72. }])
  73. dnl ################################################################################
  74. @@ -653,8 +657,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPCNT([action-if-found], [action-if-not-found])
  75. dnl # Check if TCP_KEEPCNT is supported #
  76. dnl ################################################################################
  77. AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPCNT], [{
  78. - AC_MSG_CHECKING(whether TCP_KEEPCNT is supported)
  79. - AC_TRY_RUN([/* TCP_KEEPCNT test */
  80. + AC_CACHE_CHECK([whether TCP_KEEPCNT is supported], [libzmq_cv_tcp_keepcnt],
  81. + [AC_TRY_RUN([/* TCP_KEEPCNT test */
  82. #include <sys/types.h>
  83. #include <sys/socket.h>
  84. #include <netinet/in.h>
  85. @@ -669,11 +673,13 @@ int main (int argc, char *argv [])
  86. ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPCNT, (char*) &opt, sizeof (int))) == -1)
  87. );
  88. }
  89. - ],
  90. - [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepcnt="yes" ; $1],
  91. - [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepcnt="no" ; $2],
  92. - [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepcnt="no"]
  93. + ],
  94. + [libzmq_cv_tcp_keepcnt="yes"],
  95. + [libzmq_cv_tcp_keepcnt="no"],
  96. + [libzmq_cv_tcp_keepcnt="not during cross-compile"]
  97. + )]
  98. )
  99. + AS_IF([test "x$libzmq_cv_tcp_keepcnt" = "xyes"], [$1], [$2])
  100. }])
  101. dnl ################################################################################
  102. @@ -681,8 +687,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPIDLE([action-if-found], [action-if-not-found])
  103. dnl # Check if TCP_KEEPIDLE is supported #
  104. dnl ################################################################################
  105. AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPIDLE], [{
  106. - AC_MSG_CHECKING(whether TCP_KEEPIDLE is supported)
  107. - AC_TRY_RUN([/* TCP_KEEPIDLE test */
  108. + AC_CACHE_CHECK([whether TCP_KEEPIDLE is supported], [libzmq_cv_tcp_keepidle],
  109. + [AC_TRY_RUN([/* TCP_KEEPIDLE test */
  110. #include <sys/types.h>
  111. #include <sys/socket.h>
  112. #include <netinet/in.h>
  113. @@ -697,11 +703,13 @@ int main (int argc, char *argv [])
  114. ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &opt, sizeof (int))) == -1)
  115. );
  116. }
  117. - ],
  118. - [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepidle="yes" ; $1],
  119. - [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepidle="no" ; $2],
  120. - [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepidle="no"]
  121. + ],
  122. + [libzmq_cv_tcp_keepidle="yes"],
  123. + [libzmq_cv_tcp_keepidle="no"],
  124. + [libzmq_cv_tcp_keepidle="not during cross-compile"]
  125. + )]
  126. )
  127. + AS_IF([test "x$libzmq_cv_tcp_keepidle" = "xyes"], [$1], [$2])
  128. }])
  129. dnl ################################################################################
  130. @@ -709,8 +717,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPINTVL([action-if-found], [action-if-not-found])
  131. dnl # Check if TCP_KEEPINTVL is supported #
  132. dnl ################################################################################
  133. AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPINTVL], [{
  134. - AC_MSG_CHECKING(whether TCP_KEEPINTVL is supported)
  135. - AC_TRY_RUN([/* TCP_KEEPINTVL test */
  136. + AC_CACHE_CHECK([whether TCP_KEEPINTVL is supported], [libzmq_cv_tcp_keepintvl],
  137. + [AC_TRY_RUN([/* TCP_KEEPINTVL test */
  138. #include <sys/types.h>
  139. #include <sys/socket.h>
  140. #include <netinet/in.h>
  141. @@ -725,11 +733,13 @@ int main (int argc, char *argv [])
  142. ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &opt, sizeof (int))) == -1)
  143. );
  144. }
  145. - ],
  146. - [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepintvl="yes" ; $1],
  147. - [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepintvl="no" ; $2],
  148. - [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepintvl="no"]
  149. + ],
  150. + [libzmq_cv_tcp_keepintvl="yes"],
  151. + [libzmq_cv_tcp_keepintvl="no"],
  152. + [libzmq_cv_tcp_keepintvl="not during cross-compile"]
  153. + )]
  154. )
  155. + AS_IF([test "x$libzmq_cv_tcp_keepintvl" = "xyes"], [$1], [$2])
  156. }])
  157. dnl ################################################################################
  158. @@ -737,8 +747,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPALIVE([action-if-found], [action-if-not-found])
  159. dnl # Check if TCP_KEEPALIVE is supported #
  160. dnl ################################################################################
  161. AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPALIVE], [{
  162. - AC_MSG_CHECKING(whether TCP_KEEPALIVE is supported)
  163. - AC_TRY_RUN([/* TCP_KEEPALIVE test */
  164. + AC_CACHE_CHECK([whether TCP_KEEPALIVE is supported], [libzmq_cv_tcp_keepalive],
  165. + [AC_TRY_RUN([/* TCP_KEEPALIVE test */
  166. #include <sys/types.h>
  167. #include <sys/socket.h>
  168. #include <netinet/in.h>
  169. @@ -753,11 +763,13 @@ int main (int argc, char *argv [])
  170. ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
  171. );
  172. }
  173. - ],
  174. - [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepalive="yes" ; $1],
  175. - [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepalive="no" ; $2],
  176. - [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepalive="no"]
  177. + ],
  178. + [libzmq_cv_tcp_keepalive="yes"],
  179. + [libzmq_cv_tcp_keepalive="no"],
  180. + [libzmq_cv_tcp_keepalive="not during cross-compile"]
  181. + )]
  182. )
  183. + AS_IF([test "x$libzmq_cv_tcp_keepalive" = "xyes"], [$1], [$2])
  184. }])
  185. dnl ################################################################################