forked from zeromq/czmq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacinclude.m4
More file actions
29 lines (27 loc) · 854 Bytes
/
acinclude.m4
File metadata and controls
29 lines (27 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
AC_DEFUN([AX_PROJECT_LOCAL_HOOK], [
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_LIB([pthread], [pthread_create],
[CFLAGS="${CFLAGS} -pthread"],
[AC_MSG_WARN([cannot link with -pthread.])]
)
AC_CACHE_CHECK([whether SOCK_CLOEXEC is supported], [czmq_cv_sock_cloexec],
[AC_TRY_RUN([/* SOCK_CLOEXEC test */
#include <sys/types.h>
#include <sys/socket.h>
int main (int argc, char *argv [])
{
int s = socket (PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
return (s == -1);
}
],
[czmq_cv_sock_cloexec="yes"],
[czmq_cv_sock_cloexec="no"],
[czmq_cv_sock_cloexec="not during cross-compile"]
)]
)
AS_IF([test "x$czmq_cv_sock_cloexec" = "xyes"],
AC_DEFINE([CZMQ_HAVE_SOCK_CLOEXEC],
[1],
[Whether SOCK_CLOEXEC is defined and functioning.])
)
])