File: acinclude.m4

package info (click to toggle)
czmq 4.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 9,908 kB
  • sloc: ansic: 30,811; cpp: 19,362; sh: 11,873; python: 11,814; pascal: 11,229; ruby: 8,818; java: 4,363; makefile: 299; perl: 151; javascript: 35
file content (29 lines) | stat: -rw-r--r-- 854 bytes parent folder | download | duplicates (3)
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.])
    )
])