Avoid the broken posix_spawn function on AIX 5.3 and 6.1.
[gnulib.git] / m4 / execute.m4
1 # execute.m4 serial 2
2 dnl Copyright (C) 2003, 2008 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 AC_DEFUN([gl_EXECUTE],
8 [
9   dnl Prerequisites of lib/execute.c.
10   AC_REQUIRE([AC_C_INLINE])
11   AC_REQUIRE([AC_TYPE_MODE_T])
12   AC_CHECK_HEADERS_ONCE(unistd.h)
13   AC_REQUIRE([AC_FUNC_FORK])
14   AC_CHECK_FUNC([posix_spawn],
15     [gl_POSIX_SPAWN_WORKS
16      case "$gl_cv_func_posix_spawn_works" in
17        *yes)
18          AC_DEFINE([HAVE_POSIX_SPAWN], 1,
19            [Define if you have the posix_spawn() function and it works.])
20          ;;
21      esac
22     ])
23 ])