1# sigpipe.m4 serial 2
2dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl Tests whether SIGPIPE is provided by <signal.h>.
8dnl Sets gl_cv_header_signal_h_SIGPIPE.
9AC_DEFUN([gl_SIGNAL_SIGPIPE],
10[
11  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12  dnl once only, before all statements that occur in other macros.
13  AC_REQUIRE([gl_SIGNAL_SIGPIPE_BODY])
14])
15
16AC_DEFUN([gl_SIGNAL_SIGPIPE_BODY],
17[
18  AC_REQUIRE([AC_PROG_CC])
19  AC_CACHE_CHECK([for SIGPIPE], [gl_cv_header_signal_h_SIGPIPE], [
20    AC_EGREP_CPP([booboo],[
21#include <signal.h>
22#if !defined SIGPIPE
23booboo
24#endif
25      ],
26      [gl_cv_header_signal_h_SIGPIPE=no],
27      [gl_cv_header_signal_h_SIGPIPE=yes])
28  ])
29])
30