diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-04-21 13:31:13 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-04-21 13:31:13 +0200 |
commit | 0aa8e58e6763bda1d20246155e61b7cd54cdfc65 (patch) | |
tree | eee26dc3a865f92e402b82960654b08e3fe7f79b | |
parent | 75f2bfd59e8bfefefa3ae71b875d50b2385a5dae (diff) | |
download | ODR-SourceCompanion-0aa8e58e6763bda1d20246155e61b7cd54cdfc65.tar.gz ODR-SourceCompanion-0aa8e58e6763bda1d20246155e61b7cd54cdfc65.tar.bz2 ODR-SourceCompanion-0aa8e58e6763bda1d20246155e61b7cd54cdfc65.zip |
Add MSG_NOSIGNAL and SO_NOSIGPIPE check
-rw-r--r-- | configure.ac | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index f72e59e..64aedf3 100644 --- a/configure.ac +++ b/configure.ac @@ -40,6 +40,26 @@ AX_CHECK_COMPILE_FLAG([-Wlogical-op], [CXXFLAGS="$CXXFLAGS -Wlogical-op"], [], [ AX_CHECK_COMPILE_FLAG([-Wrestrict], [CXXFLAGS="$CXXFLAGS -Wrestrict"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wdouble-promotion], [CXXFLAGS="$CXXFLAGS -Wdouble-promotion"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG(["-Wformat=2"], [CXXFLAGS="$CXXFLAGS -Wformat=2"], [], ["-Werror"]) + +# 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++]) |