83f2868094eb2c747633528e58f169a7ceb38f0a
[gnulib.git] / m4 / pipe.m4
1 # pipe.m4 serial 3
2 dnl Copyright (C) 2004, 2008, 2009 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_PIPE],
8 [
9   dnl Prerequisites of lib/pipe.h.
10   AC_CHECK_HEADERS_ONCE([unistd.h])
11   dnl Prerequisites of lib/pipe.c.
12   AC_REQUIRE([AC_C_INLINE])
13   AC_REQUIRE([AC_TYPE_MODE_T])
14   AC_REQUIRE([AC_FUNC_FORK])
15   AC_CHECK_FUNC([posix_spawn],
16     [gl_POSIX_SPAWN_WORKS
17      case "$gl_cv_func_posix_spawn_works" in
18        *yes)
19          AC_DEFINE([HAVE_POSIX_SPAWN], [1],
20            [Define if you have the posix_spawn() function and it works.])
21          ;;
22      esac
23     ])
24 ])