aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2014-03-05 13:20:11 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2014-03-05 13:20:11 +0000
commit2334950ea5670196c6b53fccb3a6c36a17042d90 (patch)
treecced5f20542346e6fe492032d8879e7a21c56c5e
parente645f9b1863414d34474131bd64d5c9d97145851 (diff)
downloadlibmicrohttpd-2334950ea5670196c6b53fccb3a6c36a17042d90.tar.gz
libmicrohttpd-2334950ea5670196c6b53fccb3a6c36a17042d90.zip
configure.ac: change configure flag from '--disable-pipe' to '--enable-soketpair' with additional check options
-rw-r--r--configure.ac45
1 files changed, 28 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index 1e4719c7..047b28a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -225,15 +225,19 @@ AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
225 ]) 225 ])
226 226
227# Check for pipe/socketpair signaling 227# Check for pipe/socketpair signaling
228AC_MSG_CHECKING([[whether to disable pipes signaling]]) 228AC_MSG_CHECKING([[whether to enable signaling by socketpair]])
229AC_ARG_ENABLE([[pipes]], 229
230 [AS_HELP_STRING([[--disable-pipes]], [[disable internal singalling by pipes and use socket pair instead]])], 230AC_ARG_ENABLE([[socketpair]],
231 [], [[enable_pipes=yes]]) 231 [AS_HELP_STRING([[--enable-socketpair[=ARG]]], [disable internal singalling by pipes and use socket pair instead (yes, no, try) [no]])], ,
232AS_IF([[test "x$os_is_windows" = "xyes"]], [disable_pipes=yes 232 [AS_IF([[test "x$os_is_windows" = "xyes"]], [enable_socketpair=yes], [enable_socketpair=no])]
233 AC_MSG_RESULT([[yes, forced on W32]])], 233 )
234 [[test "x$enable_pipes" != "xno"]], [disable_pipes=no 234
235 AC_MSG_RESULT([[$disable_pipes]])], 235AS_IF(
236 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 236 [[test "x$enable_socketpair" != "xno"]],
237 [AS_IF([[test "x$os_is_windows" = "xyes"]],
238 [ AC_MSG_RESULT([[yes, forced on W32]]) ],
239 [ AC_LINK_IFELSE(
240 [ AC_LANG_PROGRAM([[
237 #ifdef HAVE_SYS_TYPES_H 241 #ifdef HAVE_SYS_TYPES_H
238 #include <sys/types.h> 242 #include <sys/types.h>
239 #endif 243 #endif
@@ -243,15 +247,22 @@ AS_IF([[test "x$os_is_windows" = "xyes"]], [disable_pipes=yes
243 ]],[[ 247 ]],[[
244 int sv[2]; 248 int sv[2];
245 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv) != 0) return 1 249 if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv) != 0) return 1
246 250 ]])
247 ]])], 251 ],
248 [disable_pipes=yes 252 [ AC_MSG_RESULT([[yes, socketpair in available]]) ],
249 AC_MSG_RESULT([[yes, socketpair in available]])], 253 [ AC_MSG_RESULT([[no, socketpair in not available]])
250 [disable_pipes=no 254 AS_IF([[test "x$enable_socketpair" = "xyes"]], [ AC_MSG_ERROR([[socketpair signalling cannot be enabled.]]) ])
251 AC_MSG_RESULT([[no, socketpair in not available]])] 255 ]
256 )
257 ]
252 ) 258 )
253 ]) 259 ],
254if test "x$disable_pipes" = "xyes"; then 260 [
261 AC_MSG_RESULT([[no]])
262 AS_IF([[test "x$os_is_windows" = "xyes"]], [ AC_MSG_ERROR([[socketpair must be enabled on W32]]) ])
263 ]
264 )
265if test "x$enable_socketpair" = "xyes"; then
255 AC_DEFINE([[MHD_DONT_USE_PIPES]], [[1]], [Define to use pair of sockets instead of pipes for signaling]) 266 AC_DEFINE([[MHD_DONT_USE_PIPES]], [[1]], [Define to use pair of sockets instead of pipes for signaling])
256fi 267fi
257 268