X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fspawn_h.m4;h=26fec8e107d2abf0246ddb315e93dd7c6c8d4a55;hb=32d8297adbb0fc03f1e0706005e144c7f498507c;hp=da7582fc973d8cf5f3c9327201de5317b8224e74;hpb=8a81dc85e19b134d5b8ead55d9131fe87a12305b;p=gnulib.git diff --git a/m4/spawn_h.m4 b/m4/spawn_h.m4 index da7582fc9..26fec8e10 100644 --- a/m4/spawn_h.m4 +++ b/m4/spawn_h.m4 @@ -1,5 +1,5 @@ -# spawn_h.m4 serial 9 -dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. +# spawn_h.m4 serial 16 +dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -15,7 +15,6 @@ AC_DEFUN([gl_SPAWN_H], dnl is always overridden, because of GNULIB_POSIXCHECK. gl_CHECK_NEXT_HEADERS([spawn.h]) - AC_CHECK_HEADERS_ONCE([spawn.h]) if test $ac_cv_header_spawn_h = yes; then HAVE_SPAWN_H=1 AC_CHECK_TYPES([posix_spawnattr_t], [], [HAVE_POSIX_SPAWNATTR_T=0], [[ @@ -29,14 +28,16 @@ AC_DEFUN([gl_SPAWN_H], HAVE_SPAWN_H=0 HAVE_POSIX_SPAWNATTR_T=0 HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0 - gl_REPLACE_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 + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + AC_REQUIRE([gl_HAVE_POSIX_SPAWN]) AC_REQUIRE([AC_C_RESTRICT]) @@ -55,20 +56,27 @@ AC_DEFUN([gl_SPAWN_H], posix_spawn_file_actions_adddup2]) ]) -dnl Unconditionally enables the replacement of . -AC_DEFUN([gl_REPLACE_SPAWN_H], +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 This is a no-op, because is always overridden. - : + 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 ]) 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([$1]) + gl_MODULE_INDICATOR_FOR_TESTS([$1]) ]) AC_DEFUN([gl_SPAWN_H_DEFAULTS], @@ -100,4 +108,10 @@ AC_DEFUN([gl_SPAWN_H_DEFAULTS], HAVE_POSIX_SPAWN_FILE_ACTIONS_T=1; AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_T]) REPLACE_POSIX_SPAWN=0; AC_SUBST([REPLACE_POSIX_SPAWN]) + REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0; + AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE]) + REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0; + AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2]) + REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0; + AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN]) ])