summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-08 08:36:35 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-12-08 08:36:35 +0100
commitfd026d844d62d575d555b25dc48a1d7ce9a7db42 (patch)
tree45223400a0f93b94180559e4a7e3897f915dc1ed /configure.ac
parentd573723196f4f0c97e64d5a3a7adbabd3d51a429 (diff)
downloaddabmux-fd026d844d62d575d555b25dc48a1d7ce9a7db42.tar.gz
dabmux-fd026d844d62d575d555b25dc48a1d7ce9a7db42.tar.bz2
dabmux-fd026d844d62d575d555b25dc48a1d7ce9a7db42.zip
Portability: check for MSG_NOSIGNAL and SO_NOSIGPIPE
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 2c84f8f..1dd7d66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,6 +159,26 @@ AX_CHECK_COMPILE_FLAG([-Wlogical-op], [CXXFLAGS="$CXXFLAGS -Wlogical-op"])
AX_CHECK_COMPILE_FLAG([-Wrestrict], [CXXFLAGS="$CXXFLAGS -Wrestrict"])
AX_CHECK_COMPILE_FLAG([-Wdouble-promotion], [CXXFLAGS="$CXXFLAGS -Wdouble-promotion"])
AX_CHECK_COMPILE_FLAG(["-Wformat=2"], [CXXFLAGS="$CXXFLAGS -Wformat=2"])
+
+# Linux defines MSG_NOSIGNAL, some other systems have SO_NOSIGPIPE instead
+AC_MSG_CHECKING(for MSG_NOSIGNAL)
+AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
+ #include <sys/socket.h>
+ int f = MSG_NOSIGNAL;
+ ]])],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Define this symbol if you have MSG_NOSIGNAL]) ],
+ [ AC_MSG_RESULT(no) ])
+
+AC_MSG_CHECKING(for SO_NOSIGPIPE)
+AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[
+ #include <sys/socket.h>
+ int f = SO_NOSIGPIPE;
+ ]])],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SO_NOSIGPIPE, 1, [Define this symbol if you have SO_NOSIGPIPE]) ],
+ [ AC_MSG_RESULT(no) ])
+
AC_LANG_POP([C++])
# ZeroMQ