changeset 13745:6328b8d2c617

Separate the module 'waitpid' from the module 'sys_wait'. * lib/sys_wait.in.h (waitpid): Declare only if the 'waitpid' module is present. * m4/sys_wait_h.m4 (gl_SYS_WAIT_MODULE_INDICATOR): Invoke gl_MODULE_INDICATOR_FOR_TESTS. (gl_SYS_WAIT_H_DEFAULTS): Initialize GNULIB_WAITPID. * modules/sys_wait (Depends-on): Remove waitpid. (Makefile.am): Substitute GNULIB_WAITPID. * modules/waitpid (configure.ac): Invoke gl_SYS_WAIT_MODULE_INDICATOR. * tests/test-sys_wait-c++.cc (GNULIB_NAMESPACE::waitpid): Check the signature only if the 'waitpid' module is present. * doc/posix-functions/waitpid.texi: Mention the 'waitpid' module. * NEWS: Mention the change. * modules/grantpt (Depends-on): Add waitpid. * modules/wait-process (Depends-on): Likewise.
author Bruno Haible <bruno@clisp.org>
date Wed, 29 Sep 2010 16:14:55 +0200
parents 6e37c8296aa3
children 70aca43be6c1
files ChangeLog NEWS doc/posix-functions/waitpid.texi lib/sys_wait.in.h m4/sys_wait_h.m4 modules/grantpt modules/sys_wait modules/wait-process modules/waitpid tests/test-sys_wait-c++.cc
diffstat 10 files changed, 37 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-29  Bruno Haible  <bruno@clisp.org>
+
+	Separate the module 'waitpid' from the module 'sys_wait'.
+	* lib/sys_wait.in.h (waitpid): Declare only if the 'waitpid' module is
+	present.
+	* m4/sys_wait_h.m4 (gl_SYS_WAIT_MODULE_INDICATOR): Invoke
+	gl_MODULE_INDICATOR_FOR_TESTS.
+	(gl_SYS_WAIT_H_DEFAULTS): Initialize GNULIB_WAITPID.
+	* modules/sys_wait (Depends-on): Remove waitpid.
+	(Makefile.am): Substitute GNULIB_WAITPID.
+	* modules/waitpid (configure.ac): Invoke gl_SYS_WAIT_MODULE_INDICATOR.
+	* tests/test-sys_wait-c++.cc (GNULIB_NAMESPACE::waitpid): Check the
+	signature only if the 'waitpid' module is present.
+	* doc/posix-functions/waitpid.texi: Mention the 'waitpid' module.
+	* NEWS: Mention the change.
+	* modules/grantpt (Depends-on): Add waitpid.
+	* modules/wait-process (Depends-on): Likewise.
+
 2010-09-29  Bruno Haible  <bruno@clisp.org>
 
 	More tests for module 'sys_wait'.
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,10 @@
 
 Date        Modules         Changes
 
+2010-09-29  sys_wait        This module no longer provides the waitpid()
+                            function. If you need this function, you now need
+                            to request the 'waitpid' module.
+
 2010-09-17  utimens         The function gl_futimens is removed, and its
                             signature has been migrated to fdutimens.  Callers
                             of gl_futimens should change function name, and
--- a/doc/posix-functions/waitpid.texi
+++ b/doc/posix-functions/waitpid.texi
@@ -4,15 +4,15 @@
 
 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/waitpid.html}
 
-Gnulib module: ---
+Gnulib module: waitpid
 
 Portability problems fixed by Gnulib:
 @itemize
-@end itemize
-
-Portability problems not fixed by Gnulib:
-@itemize
 @item
 This function is missing on some platforms:
 mingw.
 @end itemize
+
+Portability problems not fixed by Gnulib:
+@itemize
+@end itemize
--- a/lib/sys_wait.in.h
+++ b/lib/sys_wait.in.h
@@ -113,7 +113,7 @@
 
 /* Declarations of functions.  */
 
-#if 1 /* @GNULIB_WAITPID@ */
+#if @GNULIB_WAITPID@
 # if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
 _GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
 # endif
--- a/m4/sys_wait_h.m4
+++ b/m4/sys_wait_h.m4
@@ -22,9 +22,12 @@
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
   AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
 AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS],
 [
+  GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID])
   dnl Assume proper GNU behavior unless another module says otherwise.
 ])
--- a/modules/grantpt
+++ b/modules/grantpt
@@ -9,6 +9,7 @@
 stdlib
 extensions
 pt_chown
+waitpid
 configmake
 
 configure.ac:
--- a/modules/sys_wait
+++ b/modules/sys_wait
@@ -9,7 +9,6 @@
 c++defs
 include_next
 warn-on-use
-waitpid
 
 configure.ac:
 gl_SYS_WAIT_H
@@ -27,6 +26,7 @@
 	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
 	      -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
+	      -e 's|@''GNULIB_WAITPID''@|$(GNULIB_WAITPID)|g' \
 	      -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
 	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
 	      < $(srcdir)/sys_wait.in.h; \
--- a/modules/wait-process
+++ b/modules/wait-process
@@ -17,6 +17,7 @@
 sys_wait
 unistd
 atexit
+waitpid
 
 configure.ac:
 gl_WAIT_PROCESS
--- a/modules/waitpid
+++ b/modules/waitpid
@@ -10,6 +10,7 @@
 
 configure.ac:
 gl_FUNC_WAITPID
+gl_SYS_WAIT_MODULE_INDICATOR([waitpid])
 
 Makefile.am:
 
--- a/tests/test-sys_wait-c++.cc
+++ b/tests/test-sys_wait-c++.cc
@@ -24,7 +24,9 @@
 #include "signature.h"
 
 
+#if GNULIB_TEST_WAITPID
 SIGNATURE_CHECK (GNULIB_NAMESPACE::waitpid, pid_t, (pid_t, int *, int));
+#endif
 
 
 int