From 90201eb5ff37340b85348f762effd8124449f27f Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 21 Apr 2020 14:08:13 +0200 Subject: Add check for MSG_NOSIGNAL and SO_NOSIGPIPE --- configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 4e83fd3..7986682 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,26 @@ AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [CXXFLAGS="$CXXFLAGS -Wduplicated AX_CHECK_COMPILE_FLAG([-Wlogical-op], [CXXFLAGS="$CXXFLAGS -Wlogical-op"], [], ["-Werror"]) AX_CHECK_COMPILE_FLAG([-Wrestrict], [CXXFLAGS="$CXXFLAGS -Wrestrict"], [], ["-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 + 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 + 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++]) # Check for options -- cgit v1.2.3