X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fspawn_h.m4;h=226cdcf242b7028e811c9feec02383ed9d122529;hb=062cad2d07081f9a60adbb90fc1184a435a1a93f;hp=a9bd161416db9f3cde29a77cc4723542423488ec;hpb=cbd5934b1918d73022d1d1d9904112f3d6d7f187;p=gnulib.git diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4 index a9bd16141..226cdcf24 100644 --- a/m4/spawn_h.m4 +++ b/m4/spawn_h.m4 @@ -1,4 +1,4 @@ -# spawn_h.m4 serial 6 +# 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,6 +33,8 @@ AC_DEFUN([gl_SPAWN_H], fi AC_SUBST([HAVE_SPAWN_H]) + AC_REQUIRE([gl_HAVE_POSIX_SPAWN]) + AC_REQUIRE([AC_C_RESTRICT]) dnl Check for declarations of anything we want to poison if the @@ -47,7 +49,21 @@ AC_DEFUN([gl_SPAWN_H], posix_spawnattr_getschedparam posix_spawnattr_setschedparam posix_spawn_file_actions_init posix_spawn_file_actions_destroy posix_spawn_file_actions_addopen posix_spawn_file_actions_addclose - posix_spawwn_file_actions_adddup2]) + 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 . @@ -62,6 +78,8 @@ AC_DEFUN([gl_SPAWN_MODULE_INDICATOR], dnl Use AC_REQUIRE here, so that the default settings are expanded once only. AC_REQUIRE([gl_SPAWN_H_DEFAULTS]) GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR([$1]) ]) AC_DEFUN([gl_SPAWN_H_DEFAULTS],