From 7818bf9eefbbe72990a50f47a40b1959dcdf6b8c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 19 Mar 2010 01:44:16 +0100 Subject: [PATCH] Fix bug introduced on 2010-03-14. --- ChangeLog | 8 ++++++++ m4/posix_spawn.m4 | 4 ++-- m4/spawn_h.m4 | 21 ++++++++++++++++----- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9691cf721..5e29ad37f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2010-03-18 Bruno Haible + Fix bug introduced on 2010-03-14. + * m4/spawn_h.m4 (gl_HAVE_POSIX_SPAWN): New macro. + (gl_SPAWN_H): Require it. + * m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): Likewise. + Reported by Simon Josefsson. + +2010-03-18 Bruno Haible + Fix typo introduced on 2009-12-31. * m4/spawn_h.m4 (gl_SPAWN_H): Check for the declaration of posix_spawn_file_actions_adddup2. diff --git a/m4/posix_spawn.m4 b/m4/posix_spawn.m4 index 3053bdbcb..40df135ae 100644 --- a/m4/posix_spawn.m4 +++ b/m4/posix_spawn.m4 @@ -1,4 +1,4 @@ -# posix_spawn.m4 serial 6 +# posix_spawn.m4 serial 7 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, @@ -13,7 +13,7 @@ AC_DEFUN([gl_POSIX_SPAWN], AC_DEFUN([gl_POSIX_SPAWN_BODY], [ AC_REQUIRE([gl_SPAWN_H_DEFAULTS]) - AC_CHECK_FUNCS_ONCE([posix_spawn]) + AC_REQUIRE([gl_HAVE_POSIX_SPAWN]) dnl Assume that when the main function exists, all the others, dnl except posix_spawnattr_{get,set}sched*, are available as well. dnl AC_CHECK_FUNCS_ONCE([posix_spawnp]) diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4 index da7582fc9..226cdcf24 100644 --- a/m4/spawn_h.m4 +++ b/m4/spawn_h.m4 @@ -1,4 +1,4 @@ -# spawn_h.m4 serial 9 +# spawn_h.m4 serial 10 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,10 +33,7 @@ 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([gl_HAVE_POSIX_SPAWN]) AC_REQUIRE([AC_C_RESTRICT]) @@ -55,6 +52,20 @@ AC_DEFUN([gl_SPAWN_H], posix_spawn_file_actions_adddup2]) ]) +dnl Checks whether the system has the functions posix_spawn. +dnl Sets ac_cv_func_posix_spawn and HAVE_POSIX_SPAWN. +AC_DEFUN([gl_HAVE_POSIX_SPAWN], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_SPAWN_H_DEFAULTS]) + + AC_CHECK_FUNCS_ONCE([posix_spawn]) + if test $ac_cv_func_posix_spawn != yes; then + HAVE_POSIX_SPAWN=0 + fi +]) + dnl Unconditionally enables the replacement of . AC_DEFUN([gl_REPLACE_SPAWN_H], [ -- 2.11.0