summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2008-09-26 13:37:33 +0200
committerBruno Haible <bruno@clisp.org>2008-09-26 13:44:54 +0200
commit9ff044ec4deb16682a04fb608b2576f205da48e3 (patch)
treeba4d624fa2213e5d327b9088c46279a99315c0d3 /m4
parente54c09718f6159539f37d3d9dbc3ced6a030486f (diff)
downloadgnulib-9ff044ec4deb16682a04fb608b2576f205da48e3.tar.gz
Support SIGPIPE in stdio functions for writing.
Diffstat (limited to 'm4')
-rw-r--r--m4/fprintf-posix.m44
-rw-r--r--m4/printf-posix-rpl.m46
-rw-r--r--m4/stdio_h.m436
-rw-r--r--m4/vfprintf-posix.m44
-rw-r--r--m4/vprintf-posix.m46
5 files changed, 49 insertions, 7 deletions
diff --git a/m4/fprintf-posix.m4 b/m4/fprintf-posix.m4
index 6213942a9a..4625caf6d8 100644
--- a/m4/fprintf-posix.m4
+++ b/m4/fprintf-posix.m4
@@ -1,4 +1,4 @@
-# fprintf-posix.m4 serial 11
+# fprintf-posix.m4 serial 12
dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -96,6 +96,8 @@ AC_DEFUN([gl_REPLACE_FPRINTF],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_LIBOBJ([fprintf])
REPLACE_FPRINTF=1
+ AC_DEFINE([REPLACE_FPRINTF_POSIX], 1,
+ [Define if fprintf is overridden by a POSIX compliant gnulib implementation.])
gl_PREREQ_FPRINTF
])
diff --git a/m4/printf-posix-rpl.m4 b/m4/printf-posix-rpl.m4
index 465fb5d699..f17be16c7d 100644
--- a/m4/printf-posix-rpl.m4
+++ b/m4/printf-posix-rpl.m4
@@ -1,5 +1,5 @@
-# printf-posix-rpl.m4 serial 1
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# printf-posix-rpl.m4 serial 2
+dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,6 +17,8 @@ AC_DEFUN([gl_REPLACE_PRINTF],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_LIBOBJ([printf])
REPLACE_PRINTF=1
+ AC_DEFINE([REPLACE_PRINTF_POSIX], 1,
+ [Define if printf is overridden by a POSIX compliant gnulib implementation.])
gl_PREREQ_PRINTF
])
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index a043e63bcb..dea81e3aa5 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 12
+# stdio_h.m4 serial 13
dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,28 @@ AC_DEFUN([gl_STDIO_H],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
gl_CHECK_NEXT_HEADERS([stdio.h])
+ dnl No need to create extra modules for these functions. Everyone who uses
+ dnl <stdio.h> likely needs them.
+ GNULIB_FPRINTF=1
+ GNULIB_PRINTF=1
+ GNULIB_VFPRINTF=1
+ GNULIB_VPRINTF=1
+ GNULIB_FPUTC=1
+ GNULIB_PUTC=1
+ GNULIB_PUTCHAR=1
+ GNULIB_FPUTS=1
+ GNULIB_PUTS=1
+ GNULIB_FWRITE=1
+ dnl This ifdef is just an optimization, to avoid performing a configure
+ dnl check whose result is not used. It does not make the test of
+ dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
+ m4_ifdef([gl_SIGNAL_SIGPIPE], [
+ gl_SIGNAL_SIGPIPE
+ if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+ REPLACE_STDIO_WRITE_FUNCS=1
+ AC_LIBOBJ([stdio-write])
+ fi
+ ])
])
AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
@@ -19,11 +41,15 @@ AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
AC_DEFUN([gl_STDIO_H_DEFAULTS],
[
+ GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
+ GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
+ GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
+ GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF])
GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
@@ -37,10 +63,18 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
+ GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
+ GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC])
+ GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR])
+ GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
+ GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS])
+ GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
+ GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
dnl Assume proper GNU behavior unless another module says otherwise.
+ REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
diff --git a/m4/vfprintf-posix.m4 b/m4/vfprintf-posix.m4
index d7e3272b8e..9a815128dd 100644
--- a/m4/vfprintf-posix.m4
+++ b/m4/vfprintf-posix.m4
@@ -1,4 +1,4 @@
-# vfprintf-posix.m4 serial 11
+# vfprintf-posix.m4 serial 12
dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -96,6 +96,8 @@ AC_DEFUN([gl_REPLACE_VFPRINTF],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_LIBOBJ([vfprintf])
REPLACE_VFPRINTF=1
+ AC_DEFINE([REPLACE_VFPRINTF_POSIX], 1,
+ [Define if vfprintf is overridden by a POSIX compliant gnulib implementation.])
gl_PREREQ_VFPRINTF
])
diff --git a/m4/vprintf-posix.m4 b/m4/vprintf-posix.m4
index ac44cbe063..0bc0840a9e 100644
--- a/m4/vprintf-posix.m4
+++ b/m4/vprintf-posix.m4
@@ -1,5 +1,5 @@
-# vprintf-posix.m4 serial 1
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# vprintf-posix.m4 serial 2
+dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -17,6 +17,8 @@ AC_DEFUN([gl_REPLACE_VPRINTF],
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_LIBOBJ([vprintf])
REPLACE_VPRINTF=1
+ AC_DEFINE([REPLACE_VPRINTF_POSIX], 1,
+ [Define if vprintf is overridden by a POSIX compliant gnulib implementation.])
gl_PREREQ_VPRINTF
])