Fix compilation error when modules 'posix_spawn[p]' are not used.
authorBruno Haible <bruno@clisp.org>
Sun, 14 Mar 2010 19:12:57 +0000 (20:12 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 14 Mar 2010 19:12:57 +0000 (20:12 +0100)
ChangeLog
m4/posix_spawn.m4
m4/spawn_h.m4

index 129dd8affb7675f83c9cced3fadad08b2cbbff3d..463ca9103c0c6c923ddb8d9e403d7aa7fd5105b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-14  Bruno Haible  <bruno@clisp.org>
+
+       Fix compilation error when modules 'posix_spawn[p]' are not used.
+       * m4/spawn_h.m4 (gl_SPAWN_H): Set HAVE_POSIX_SPAWN here.
+       * m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): ... not here.
+
 2010-03-14  Bruno Haible  <bruno@clisp.org>
 
        Fix compilation error on mingw when module 'time_r' is not used.
index 89e2f7f06477daa9993a4c9a0eeeab1ef05a9a0d..3053bdbcbaf571c140706a8da22bfadcb5aaf72b 100644 (file)
@@ -1,4 +1,4 @@
-# posix_spawn.m4 serial 5
+# posix_spawn.m4 serial 6
 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -69,8 +69,6 @@ AC_DEFUN([gl_POSIX_SPAWN_BODY],
         ;;
       *) REPLACE_POSIX_SPAWN=1 ;;
     esac
-  else
-    HAVE_POSIX_SPAWN=0
   fi
 ])
 
index fb789f01e1cb069f918d2681ee5a2df4da465350..22511c7026cd51315ebb8761abd390ae875c9333 100644 (file)
@@ -1,4 +1,4 @@
-# spawn_h.m4 serial 7
+# spawn_h.m4 serial 8
 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -33,6 +33,11 @@ AC_DEFUN([gl_SPAWN_H],
   fi
   AC_SUBST([HAVE_SPAWN_H])
 
+  AC_CHECK_FUNCS_ONCE([posix_spawn])
+  if test $ac_cv_func_posix_spawn != yes; then
+    HAVE_POSIX_SPAWN=0
+  fi
+
   AC_REQUIRE([AC_C_RESTRICT])
 
   dnl Check for declarations of anything we want to poison if the