docs: cmake build
[m6w6/libmemcached] / m4 / socket_send_flags.m4
1 # Copyright (C) 2012-2013 Data Differential LLC
2 # Copyright (C) 2011 Trond Norbye
3 # This file is free software; Trond Norbye and Data Differential
4 # gives unlimited permission to copy and/or distribute it,
5 # with or without modifications, as long as this notice is preserved.
6 # ---------------------------------------------------------------------------
7 # Macro: SOCKET_SEND_FLAGS
8 # ---------------------------------------------------------------------------
9 #
10
11 #serial 2
12
13 AC_DEFUN([SOCKET_SEND_FLAGS],
14 [AC_CACHE_CHECK([for MSG_NOSIGNAL],[ac_cv_msg_nosignal],
15 [AC_LANG_PUSH([C])
16 AX_SAVE_FLAGS
17 CFLAGS="$CFLAGS -I${srcdir}"
18
19 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>], [int flags= MSG_NOSIGNAL])], [ac_cv_msg_nosignal="yes"])
20 AC_LANG_POP
21 AX_RESTORE_FLAGS])
22
23 AC_CACHE_CHECK([for MSG_DONTWAIT],[ac_cv_msg_dontwait],
24 [AC_LANG_PUSH([C])
25 AX_SAVE_FLAGS
26 CFLAGS="$CFLAGS -I${srcdir}"
27
28 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],[int flags= MSG_DONTWAIT])],[ac_cv_msg_dontwait="yes"])
29 AC_LANG_POP
30 AX_RESTORE_FLAGS])
31
32 AC_CACHE_CHECK([for MSG_MORE],[ac_cv_msg_more],
33 [AC_LANG_PUSH([C])
34 AX_SAVE_FLAGS
35 CFLAGS="$CFLAGS -I${srcdir}"
36 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>], [int flags= MSG_MORE])], [ac_cv_msg_more="yes"])
37 AC_LANG_POP
38 AX_RESTORE_FLAGS])
39
40 AS_IF([test "x$ac_cv_msg_nosignal" = "xyes"],[AC_DEFINE([HAVE_MSG_NOSIGNAL],[1],[Define to 1 if you have a MSG_NOSIGNAL])])
41 AS_IF([test "x$ac_cv_msg_dontwait" = "xyes"],[AC_DEFINE([HAVE_MSG_DONTWAIT],[1],[Define to 1 if you have a MSG_DONTWAIT])])
42 AS_IF([test "x$ac_cv_msg_more" = "xyes"],[AC_DEFINE([HAVE_MSG_MORE],[1],[Define to 1 if you have a MSG_MORE])])
43 ])
44
45 # ---------------------------------------------------------------------------
46 # End Macro: SOCKET_SEND_FLAGS
47 # ---------------------------------------------------------------------------