Don't require lib/stdio-write.c when only module 'stdio' is used.
authorBruno Haible <bruno@clisp.org>
Fri, 15 Apr 2011 08:46:01 +0000 (10:46 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 15 Apr 2011 08:46:01 +0000 (10:46 +0200)
* m4/stdio_h.m4 (gl_STDIO_H): Move the AC_LIBOBJ back into the m4_ifdef
invocation.
Reported by Rob Vermaas <rob.vermaas@gmail.com>.

ChangeLog
m4/stdio_h.m4

index b6fdfddb1c7f604f33672d60effddbeb431dec1a..580cfa34e376fec50bdb25a5c0de3495a8cb08dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-04-15  Bruno Haible  <bruno@clisp.org>
+
+       Don't require lib/stdio-write.c when only module 'stdio' is used.
+       * m4/stdio_h.m4 (gl_STDIO_H): Move the AC_LIBOBJ back into the m4_ifdef
+       invocation.
+       Reported by Rob Vermaas <rob.vermaas@gmail.com>.
+
 2011-04-14  Bruno Haible  <bruno@clisp.org>
 
        Support non-blocking pipe I/O in read() on native Windows.
 2011-04-14  Bruno Haible  <bruno@clisp.org>
 
        Support non-blocking pipe I/O in read() on native Windows.
index 8a351363e6f0d28841066e63e4fe96ad11870441..8b013c2f352047aed82035ee27c6cdbc0dc59bbf 100644 (file)
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 35
+# stdio_h.m4 serial 36
 dnl Copyright (C) 2007-2011 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 Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,9 +22,11 @@ AC_DEFUN([gl_STDIO_H],
   GNULIB_FGETS=1
   GNULIB_GETS=1
   GNULIB_FREAD=1
   GNULIB_FGETS=1
   GNULIB_GETS=1
   GNULIB_FREAD=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_NONBLOCKING or GNULIB_NONBLOCKING redundant.
+  dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
+  dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+  dnl also an optimization, to avoid performing a configure check whose result
+  dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+  dnl or GNULIB_NONBLOCKING redundant.
   m4_ifdef([gl_NONBLOCKING_IO], [
     gl_NONBLOCKING_IO
     if test $gl_cv_have_nonblocking != yes; then
   m4_ifdef([gl_NONBLOCKING_IO], [
     gl_NONBLOCKING_IO
     if test $gl_cv_have_nonblocking != yes; then
@@ -45,24 +47,30 @@ AC_DEFUN([gl_STDIO_H],
   GNULIB_FPUTS=1
   GNULIB_PUTS=1
   GNULIB_FWRITE=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.
+  dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+  dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+  dnl also an optimization, to avoid performing a configure check whose result
+  dnl is not used. But it does not make the test of GNULIB_STDIO_H_SIGPIPE or
+  dnl 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
   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
   ])
     fi
   ])
+  dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
+  dnl "expected source file, required through AC_LIBSOURCES, not found". It is
+  dnl also an optimization, to avoid performing a configure check whose result
+  dnl is not used. But it does not make the test of GNULIB_STDIO_H_NONBLOCKING
+  dnl or GNULIB_NONBLOCKING redundant.
   m4_ifdef([gl_NONBLOCKING_IO], [
     gl_NONBLOCKING_IO
     if test $gl_cv_have_nonblocking != yes; then
       REPLACE_STDIO_WRITE_FUNCS=1
   m4_ifdef([gl_NONBLOCKING_IO], [
     gl_NONBLOCKING_IO
     if test $gl_cv_have_nonblocking != yes; then
       REPLACE_STDIO_WRITE_FUNCS=1
+      AC_LIBOBJ([stdio-write])
     fi
   ])
     fi
   ])
-  if test $REPLACE_STDIO_WRITE_FUNCS = 1; then
-    AC_LIBOBJ([stdio-write])
-  fi
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use, and which is not
 
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use, and which is not