X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fspawn_h.m4;h=371d00c481ffac07689b5e5638daf7bfe21ed4d6;hb=217ec874c8e4610ce407f0204c4e3fe30b7c76ec;hp=11f399eff6d7033525833acafd3fa7cce9cfbee7;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4 index 11f399eff..371d00c48 100644 --- a/m4/spawn_h.m4 +++ b/m4/spawn_h.m4 @@ -1,4 +1,4 @@ -# spawn_h.m4 serial 5 +# spawn_h.m4 serial 11 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,7 +33,37 @@ 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 + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include + ]], [posix_spawn posix_spawnp posix_spawnattr_init posix_spawnattr_destroy + posix_spawnattr_getsigdefault posix_spawnattr_setsigdefault + posix_spawnattr_getsigmask posix_spawnattr_setsigmask + posix_spawnattr_getflags posix_spawnattr_setflags + posix_spawnattr_getpgroup posix_spawnattr_setpgroup + posix_spawnattr_getschedpolicy posix_spawnattr_setschedpolicy + 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_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 . @@ -47,7 +77,9 @@ 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 + 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_SPAWN_H_DEFAULTS],