File: socket_send_flags.m4

package info (click to toggle)
libmemcached 1.0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,912 kB
  • sloc: cpp: 39,309; ansic: 18,449; sh: 11,864; python: 603; yacc: 437; lex: 195; makefile: 116
file content (46 lines) | stat: -rw-r--r-- 1,882 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
dnl  Copyright (C) 2012 Data Differential LLC
dnl  Copyright (C) 2011 Trond Norbye
dnl This file is free software; Trond Norbye
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl ---------------------------------------------------------------------------
dnl Macro: SOCKET_SEND_FLAGS
dnl ---------------------------------------------------------------------------

AC_DEFUN([SOCKET_SEND_FLAGS],
[
  AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [
    AC_LANG_PUSH([C])
    save_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -I${srcdir}"

    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>], [ int flags= MSG_NOSIGNAL ])], [ac_cv_msg_nosignal="yes"])
    AC_LANG_POP
  ])

  AC_CACHE_CHECK([for MSG_DONTWAIT], [ac_cv_msg_dontwait], [
    AC_LANG_PUSH([C])
    save_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -I${srcdir}"

    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>], [ int flags= MSG_DONTWAIT ])], [ac_cv_msg_dontwait="yes"])
    AC_LANG_POP
  ])

  AC_CACHE_CHECK([for MSG_MORE], [ac_cv_msg_more], [
    AC_LANG_PUSH([C])
    save_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS -I${srcdir}"

    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>], [ int flags= MSG_MORE ])], [ac_cv_msg_more="yes"])
    AC_LANG_POP
  ])

  AS_IF([test "x$ac_cv_msg_nosignal" = "xyes"],[ AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Define to 1 if you have a MSG_NOSIGNAL])])
  AS_IF([test "x$ac_cv_msg_dontwait" = "xyes"],[ AC_DEFINE(HAVE_MSG_DONTWAIT, 1, [Define to 1 if you have a MSG_DONTWAIT])])
  AS_IF([test "x$ac_cv_msg_more" = "xyes"],[ AC_DEFINE(HAVE_MSG_MORE, 1, [Define to 1 if you have a MSG_MORE])])
])

dnl ---------------------------------------------------------------------------
dnl End Macro: SOCKET_SEND_FLAGS
dnl ---------------------------------------------------------------------------