socket_send_flags.m4 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #serial 2
  11. AC_DEFUN([SOCKET_SEND_FLAGS],
  12. [AC_CACHE_CHECK([for MSG_NOSIGNAL],[ac_cv_msg_nosignal],
  13. [AC_LANG_PUSH([C])
  14. AX_SAVE_FLAGS
  15. CFLAGS="$CFLAGS -I${srcdir}"
  16. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>], [int flags= MSG_NOSIGNAL])], [ac_cv_msg_nosignal="yes"])
  17. AC_LANG_POP
  18. AX_RESTORE_FLAGS])
  19. AC_CACHE_CHECK([for MSG_DONTWAIT],[ac_cv_msg_dontwait],
  20. [AC_LANG_PUSH([C])
  21. AX_SAVE_FLAGS
  22. CFLAGS="$CFLAGS -I${srcdir}"
  23. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>],[int flags= MSG_DONTWAIT])],[ac_cv_msg_dontwait="yes"])
  24. AC_LANG_POP
  25. AX_RESTORE_FLAGS])
  26. AC_CACHE_CHECK([for MSG_MORE],[ac_cv_msg_more],
  27. [AC_LANG_PUSH([C])
  28. AX_SAVE_FLAGS
  29. CFLAGS="$CFLAGS -I${srcdir}"
  30. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>], [int flags= MSG_MORE])], [ac_cv_msg_more="yes"])
  31. AC_LANG_POP
  32. AX_RESTORE_FLAGS])
  33. AS_IF([test "x$ac_cv_msg_nosignal" = "xyes"],[AC_DEFINE([HAVE_MSG_NOSIGNAL],[1],[Define to 1 if you have a MSG_NOSIGNAL])])
  34. AS_IF([test "x$ac_cv_msg_dontwait" = "xyes"],[AC_DEFINE([HAVE_MSG_DONTWAIT],[1],[Define to 1 if you have a MSG_DONTWAIT])])
  35. AS_IF([test "x$ac_cv_msg_more" = "xyes"],[AC_DEFINE([HAVE_MSG_MORE],[1],[Define to 1 if you have a MSG_MORE])])
  36. ])
  37. # ---------------------------------------------------------------------------
  38. # End Macro: SOCKET_SEND_FLAGS
  39. # ---------------------------------------------------------------------------