[Define to 1 to enable symbolic link timestamp checking.])
])
+# Use posix_spawn if we have support and the user didn't disable it
+
+AC_ARG_ENABLE([posix-spawn],
+ AC_HELP_STRING([--disable-posix-spawn],
+ [disable support for posix_spawn()]),
+ [make_cv_posix_spawn="$enableval" user_posix_spawn="$enableval"],
+ [make_cv_posix_spawn="yes"])
+
+AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/],
+ [*/no/*], [make_cv_posix_spawn=no])
+
+AS_CASE([/$make_cv_posix_spawn/$user_posix_spawn/],
+ [*/no/*], [make_cv_posix_spawn=no],
+ [AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().])
+ ])
+
# Find the SCCS commands, so we can include them in our default rules.
AC_CACHE_CHECK([for location of SCCS get command], [make_cv_path_sccs_get], [
echo
])
+AS_IF([test "x$make_cv_posix_spawn" = xno && test "x$user_posix_spawn" = xyes],
+[ echo
+ echo "WARNING: posix_spawn() is not supported on this system."
+ echo
+])
+
# Specify what files are to be created.
AC_CONFIG_FILES([Makefile lib/Makefile po/Makefile.in doc/Makefile \
tests/config-flags.pm])
checkcfg.--disable-job-server \
checkcfg.--disable-load \
checkcfg.--without-guile \
+ checkcfg.--disable-posix-spawn \
checkcfg.make_cv_sys_gnu_glob^no \
checkcfg.ac_cv_func_getloadavg^no+ac_cv_have_decl_getloadavg^no+gl_cv_have_raw_decl_getloadavg^no+ac_cv_lib_util_getloadavg^no+ac_cv_lib_getloadavg_getloadavg^no \
checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \
# endif /* Have wait3. */
#endif /* Have waitpid. */
-#ifdef HAVE_SPAWN_H
+#ifdef USE_POSIX_SPAWN
# include <spawn.h>
-#endif /* have spawn.h */
+#endif
#if !defined (wait) && !defined (POSIX)
int wait ();
const int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
int fdout = FD_STDOUT;
int fderr = FD_STDERR;
- int r;
pid_t pid;
-#if HAVE_POSIX_SPAWN
+ int r;
+#if USE_POSIX_SPAWN
short flags = 0;
posix_spawnattr_t attr;
posix_spawn_file_actions_t fa;
-#endif /* have posix_spawn() */
+#endif
/* Divert child output if we want to capture it. */
if (out && out->syncout)
fderr = out->err;
}
-#if ! HAVE_POSIX_SPAWN
- /* does not have posix_spawn() */
+#if !defined(USE_POSIX_SPAWN)
pid = vfork();
if (pid != 0)